chore: use file-scoped namespace

This commit is contained in:
NaBian committed 2022-03-13 20:28:58 +08:00
1 parent 99d2fafb72
commit bbf1b7d4c6
748 files changed
+57929 -58678

No files matched your search

@@ -1,40 +1,39 @@
using System.Windows;
using System.Windows.Media.Imaging;
namespace HandyControlDemo.UserControl
namespace HandyControlDemo.UserControl;
public partial class Avatar
{
public partial class Avatar
public Avatar()
{
public Avatar()
{
InitializeComponent();
}
public static readonly DependencyProperty SourceProperty = DependencyProperty.Register(
"Source", typeof(BitmapFrame), typeof(Avatar), new PropertyMetadata(default(BitmapFrame)));
public BitmapFrame Source
{
get => (BitmapFrame) GetValue(SourceProperty);
set => SetValue(SourceProperty, value);
}
public static readonly DependencyProperty UserNameProperty = DependencyProperty.Register(
"DisplayName", typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
public string DisplayName
{
get => (string) GetValue(UserNameProperty);
set => SetValue(UserNameProperty, value);
}
public static readonly DependencyProperty LinkProperty = DependencyProperty.Register(
"Link", typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
public string Link
{
get => (string) GetValue(LinkProperty);
set => SetValue(LinkProperty, value);
}
InitializeComponent();
}
}
public static readonly DependencyProperty SourceProperty = DependencyProperty.Register(
"Source", typeof(BitmapFrame), typeof(Avatar), new PropertyMetadata(default(BitmapFrame)));
public BitmapFrame Source
{
get => (BitmapFrame) GetValue(SourceProperty);
set => SetValue(SourceProperty, value);
}
public static readonly DependencyProperty UserNameProperty = DependencyProperty.Register(
"DisplayName", typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
public string DisplayName
{
get => (string) GetValue(UserNameProperty);
set => SetValue(UserNameProperty, value);
}
public static readonly DependencyProperty LinkProperty = DependencyProperty.Register(
"Link", typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
public string Link
{
get => (string) GetValue(LinkProperty);
set => SetValue(LinkProperty, value);
}
}
@@ -1,22 +1,21 @@
using System.Windows.Controls;
using HandyControl.Tools;
namespace HandyControlDemo.UserControl
namespace HandyControlDemo.UserControl;
public partial class ChatBox
{
public partial class ChatBox
private ScrollViewer _scrollViewer;
public ChatBox()
{
private ScrollViewer _scrollViewer;
public ChatBox()
{
InitializeComponent();
ListBoxChat.ItemContainerGenerator.ItemsChanged += ItemContainerGenerator_ItemsChanged;
}
private void ItemContainerGenerator_ItemsChanged(object sender, System.Windows.Controls.Primitives.ItemsChangedEventArgs e)
{
_scrollViewer ??= VisualHelper.GetChild<ScrollViewer>(ListBoxChat);
_scrollViewer?.ScrollToBottom();
}
InitializeComponent();
ListBoxChat.ItemContainerGenerator.ItemsChanged += ItemContainerGenerator_ItemsChanged;
}
}
private void ItemContainerGenerator_ItemsChanged(object sender, System.Windows.Controls.Primitives.ItemsChangedEventArgs e)
{
_scrollViewer ??= VisualHelper.GetChild<ScrollViewer>(ListBoxChat);
_scrollViewer?.ScrollToBottom();
}
}
@@ -1,19 +1,18 @@
using System.Windows;
using HandyControlDemo.Data;
namespace HandyControlDemo.UserControl
namespace HandyControlDemo.UserControl;
public partial class GeometryItem
{
public partial class GeometryItem
public GeometryItem() => InitializeComponent();
public static readonly DependencyProperty InfoProperty = DependencyProperty.Register(
"Info", typeof(GeometryItemModel), typeof(GeometryItem), new PropertyMetadata(default(GeometryItemModel)));
public GeometryItemModel Info
{
public GeometryItem() => InitializeComponent();
public static readonly DependencyProperty InfoProperty = DependencyProperty.Register(
"Info", typeof(GeometryItemModel), typeof(GeometryItem), new PropertyMetadata(default(GeometryItemModel)));
public GeometryItemModel Info
{
get => (GeometryItemModel) GetValue(InfoProperty);
set => SetValue(InfoProperty, value);
}
get => (GeometryItemModel) GetValue(InfoProperty);
set => SetValue(InfoProperty, value);
}
}
}
@@ -1,7 +1,6 @@
namespace HandyControlDemo.UserControl
{
internal interface IFull
{
namespace HandyControlDemo.UserControl;
}
}
internal interface IFull
{
}
@@ -1,10 +1,9 @@
namespace HandyControlDemo.UserControl
namespace HandyControlDemo.UserControl;
public partial class InteractiveDialog
{
public partial class InteractiveDialog
public InteractiveDialog()
{
public InteractiveDialog()
{
InitializeComponent();
}
InitializeComponent();
}
}
}
@@ -1,10 +1,9 @@
namespace HandyControlDemo.UserControl
namespace HandyControlDemo.UserControl;
public partial class TextDialog
{
public partial class TextDialog
public TextDialog()
{
public TextDialog()
{
InitializeComponent();
}
InitializeComponent();
}
}
}
@@ -2,23 +2,22 @@
using System.Windows.Controls.Primitives;
using HandyControl.Tools;
namespace HandyControlDemo.UserControl
namespace HandyControlDemo.UserControl;
public partial class TextDialogWithTimer
{
public partial class TextDialogWithTimer
public TextDialogWithTimer()
{
public TextDialogWithTimer()
{
InitializeComponent();
InitializeComponent();
var animation = AnimationHelper.CreateAnimation(100, 5000);
animation.EasingFunction = null;
animation.Completed += Animation_Completed;
ProgressBarTimer.BeginAnimation(RangeBase.ValueProperty, animation);
}
private void Animation_Completed(object sender, EventArgs e)
{
ButtonClose.Command.Execute(null);
}
var animation = AnimationHelper.CreateAnimation(100, 5000);
animation.EasingFunction = null;
animation.Completed += Animation_Completed;
ProgressBarTimer.BeginAnimation(RangeBase.ValueProperty, animation);
}
}
private void Animation_Completed(object sender, EventArgs e)
{
ButtonClose.Command.Execute(null);
}
}