chore: use file-scoped namespace
This commit is contained in:
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);
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class AnimationPathDemoCtl
|
||||
{
|
||||
public partial class AnimationPathDemoCtl
|
||||
public AnimationPathDemoCtl()
|
||||
{
|
||||
public AnimationPathDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class AutoCompleteTextBoxDemoCtl
|
||||
{
|
||||
public partial class AutoCompleteTextBoxDemoCtl
|
||||
public AutoCompleteTextBoxDemoCtl()
|
||||
{
|
||||
public AutoCompleteTextBoxDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class BadgeDemoCtl
|
||||
{
|
||||
public partial class BadgeDemoCtl
|
||||
public BadgeDemoCtl()
|
||||
{
|
||||
public BadgeDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+33
-34
@@ -1,40 +1,39 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Media.Imaging;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class ButtonGroupDemoCtl
|
||||
{
|
||||
public partial class ButtonGroupDemoCtl
|
||||
public ButtonGroupDemoCtl()
|
||||
{
|
||||
public ButtonGroupDemoCtl()
|
||||
{
|
||||
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);
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class CalendarWithClockDemoCtl
|
||||
{
|
||||
public partial class CalendarWithClockDemoCtl
|
||||
public CalendarWithClockDemoCtl()
|
||||
{
|
||||
public CalendarWithClockDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class CardDemoCtl
|
||||
{
|
||||
public partial class CardDemoCtl
|
||||
public CardDemoCtl()
|
||||
{
|
||||
public CardDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class CarouselDemoCtl
|
||||
{
|
||||
public partial class CarouselDemoCtl
|
||||
public CarouselDemoCtl()
|
||||
{
|
||||
public CarouselDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class ChatBubbleDemoCtl
|
||||
{
|
||||
public partial class ChatBubbleDemoCtl
|
||||
public ChatBubbleDemoCtl()
|
||||
{
|
||||
public ChatBubbleDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class CheckComboBoxDemoCtl
|
||||
{
|
||||
public partial class CheckComboBoxDemoCtl
|
||||
public CheckComboBoxDemoCtl()
|
||||
{
|
||||
public CheckComboBoxDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class CirclePanelDemoCtl
|
||||
{
|
||||
public partial class CirclePanelDemoCtl
|
||||
public CirclePanelDemoCtl()
|
||||
{
|
||||
public CirclePanelDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class ClockDemoCtl
|
||||
{
|
||||
public partial class ClockDemoCtl
|
||||
public ClockDemoCtl()
|
||||
{
|
||||
public ClockDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class ColorPickerDemoCtl
|
||||
{
|
||||
public partial class ColorPickerDemoCtl
|
||||
public ColorPickerDemoCtl()
|
||||
{
|
||||
public ColorPickerDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class ComboBoxDemoCtl
|
||||
{
|
||||
public partial class ComboBoxDemoCtl
|
||||
public ComboBoxDemoCtl()
|
||||
{
|
||||
public ComboBoxDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -1,11 +1,10 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class CompareSliderDemoCtl
|
||||
{
|
||||
public partial class CompareSliderDemoCtl
|
||||
public CompareSliderDemoCtl()
|
||||
{
|
||||
public CompareSliderDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,28 +1,27 @@
|
||||
using System;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class CoverFlowDemoCtl
|
||||
{
|
||||
public partial class CoverFlowDemoCtl
|
||||
public CoverFlowDemoCtl()
|
||||
{
|
||||
public CoverFlowDemoCtl()
|
||||
InitializeComponent();
|
||||
|
||||
CoverFlowMain.AddRange(new[]
|
||||
{
|
||||
InitializeComponent();
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/1.jpg"),
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/2.jpg"),
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/3.jpg"),
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/4.jpg"),
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/5.jpg"),
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/6.jpg"),
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/7.jpg"),
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/8.jpg"),
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/9.jpg"),
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/10.jpg")
|
||||
});
|
||||
|
||||
CoverFlowMain.AddRange(new[]
|
||||
{
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/1.jpg"),
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/2.jpg"),
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/3.jpg"),
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/4.jpg"),
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/5.jpg"),
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/6.jpg"),
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/7.jpg"),
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/8.jpg"),
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/9.jpg"),
|
||||
new Uri(@"pack://application:,,,/Resources/Img/Album/10.jpg")
|
||||
});
|
||||
|
||||
CoverFlowMain.PageIndex = 2;
|
||||
}
|
||||
CoverFlowMain.PageIndex = 2;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class CoverViewDemoCtl
|
||||
{
|
||||
public partial class CoverViewDemoCtl
|
||||
public CoverViewDemoCtl()
|
||||
{
|
||||
public CoverViewDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class DatePickerDemoCtl
|
||||
{
|
||||
public partial class DatePickerDemoCtl
|
||||
public DatePickerDemoCtl()
|
||||
{
|
||||
public DatePickerDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class DateTimePickerDemoCtl
|
||||
{
|
||||
public partial class DateTimePickerDemoCtl
|
||||
public DateTimePickerDemoCtl()
|
||||
{
|
||||
public DateTimePickerDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class DialogDemoCtl
|
||||
{
|
||||
public partial class DialogDemoCtl
|
||||
public DialogDemoCtl()
|
||||
{
|
||||
public DialogDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class DividerDemoCtl
|
||||
{
|
||||
public partial class DividerDemoCtl
|
||||
public DividerDemoCtl()
|
||||
{
|
||||
public DividerDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class DrawerDemoCtl
|
||||
{
|
||||
public partial class DrawerDemoCtl
|
||||
public DrawerDemoCtl()
|
||||
{
|
||||
public DrawerDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class ElementGroupDemoCtl
|
||||
{
|
||||
public partial class ElementGroupDemoCtl
|
||||
public ElementGroupDemoCtl()
|
||||
{
|
||||
public ElementGroupDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class FlexPanelDemoCtl : IFull
|
||||
{
|
||||
public partial class FlexPanelDemoCtl : IFull
|
||||
public FlexPanelDemoCtl()
|
||||
{
|
||||
public FlexPanelDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class FlipClockDemoCtl
|
||||
{
|
||||
public partial class FlipClockDemoCtl
|
||||
public FlipClockDemoCtl()
|
||||
{
|
||||
public FlipClockDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class FloatingBlockDemoCtl
|
||||
{
|
||||
public partial class FloatingBlockDemoCtl
|
||||
public FloatingBlockDemoCtl()
|
||||
{
|
||||
public FloatingBlockDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,17 +1,16 @@
|
||||
using System;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class GifImageDemoCtl : IDisposable
|
||||
{
|
||||
public GifImageDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
GifImageMain.Dispose();
|
||||
}
|
||||
public partial class GifImageDemoCtl : IDisposable
|
||||
{
|
||||
public GifImageDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
GifImageMain.Dispose();
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class GotoTopDemoCtl
|
||||
{
|
||||
public partial class GotoTopDemoCtl
|
||||
public GotoTopDemoCtl()
|
||||
{
|
||||
public GotoTopDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class GravatarDemoCtl
|
||||
{
|
||||
public partial class GravatarDemoCtl
|
||||
public GravatarDemoCtl()
|
||||
{
|
||||
public GravatarDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class GridDemoCtl : IFull
|
||||
{
|
||||
public partial class GridDemoCtl : IFull
|
||||
public GridDemoCtl()
|
||||
{
|
||||
public GridDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class GrowlDemoCtl
|
||||
{
|
||||
public partial class GrowlDemoCtl
|
||||
public GrowlDemoCtl()
|
||||
{
|
||||
public GrowlDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class HoneycombPanelDemoCtl
|
||||
{
|
||||
public partial class HoneycombPanelDemoCtl
|
||||
public HoneycombPanelDemoCtl()
|
||||
{
|
||||
public HoneycombPanelDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class ImageBlockDemoCtl
|
||||
{
|
||||
public partial class ImageBlockDemoCtl
|
||||
public ImageBlockDemoCtl()
|
||||
{
|
||||
public ImageBlockDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class ImageBrowserDemoCtl
|
||||
{
|
||||
public partial class ImageBrowserDemoCtl
|
||||
public ImageBrowserDemoCtl()
|
||||
{
|
||||
public ImageBrowserDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class ImageSelectorDemoCtl
|
||||
{
|
||||
public partial class ImageSelectorDemoCtl
|
||||
public ImageSelectorDemoCtl()
|
||||
{
|
||||
public ImageSelectorDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class LoadingDemoCtl
|
||||
{
|
||||
public partial class LoadingDemoCtl
|
||||
public LoadingDemoCtl()
|
||||
{
|
||||
public LoadingDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class MagnifierDemoCtl
|
||||
{
|
||||
public partial class MagnifierDemoCtl
|
||||
public MagnifierDemoCtl()
|
||||
{
|
||||
public MagnifierDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class NotificationDemoCtl
|
||||
{
|
||||
public partial class NotificationDemoCtl
|
||||
public NotificationDemoCtl()
|
||||
{
|
||||
public NotificationDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -2,20 +2,19 @@
|
||||
using HandyControlDemo.Tools;
|
||||
using HandyControlDemo.ViewModel;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class NotifyIconDemoCtl
|
||||
{
|
||||
public partial class NotifyIconDemoCtl
|
||||
public NotifyIconDemoCtl()
|
||||
{
|
||||
public NotifyIconDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
InitializeComponent();
|
||||
|
||||
AssemblyHelper.Register(nameof(NotifyIconDemoCtl), this);
|
||||
Unloaded += NotifyIconDemoCtl_Unloaded;
|
||||
}
|
||||
|
||||
private void NotifyIconDemoCtl_Unloaded(object sender, RoutedEventArgs e) => ViewModelLocator.Instance.NotifyIconDemo.Cleanup();
|
||||
|
||||
private void ButtonPush_OnClick(object sender, RoutedEventArgs e) => NotifyIconContextContent.CloseContextControl();
|
||||
AssemblyHelper.Register(nameof(NotifyIconDemoCtl), this);
|
||||
Unloaded += NotifyIconDemoCtl_Unloaded;
|
||||
}
|
||||
}
|
||||
|
||||
private void NotifyIconDemoCtl_Unloaded(object sender, RoutedEventArgs e) => ViewModelLocator.Instance.NotifyIconDemo.Cleanup();
|
||||
|
||||
private void ButtonPush_OnClick(object sender, RoutedEventArgs e) => NotifyIconContextContent.CloseContextControl();
|
||||
}
|
||||
+6
-7
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class NumericUpDownDemoCtl
|
||||
{
|
||||
public partial class NumericUpDownDemoCtl
|
||||
public NumericUpDownDemoCtl()
|
||||
{
|
||||
public NumericUpDownDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class OutlineTextDemoCtl
|
||||
{
|
||||
public partial class OutlineTextDemoCtl
|
||||
public OutlineTextDemoCtl()
|
||||
{
|
||||
public OutlineTextDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class PaginationDemoCtl
|
||||
{
|
||||
public partial class PaginationDemoCtl
|
||||
public PaginationDemoCtl()
|
||||
{
|
||||
public PaginationDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class PasswordBoxDemoCtl
|
||||
{
|
||||
public partial class PasswordBoxDemoCtl
|
||||
public PasswordBoxDemoCtl()
|
||||
{
|
||||
public PasswordBoxDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,21 +1,20 @@
|
||||
using System.Windows;
|
||||
using HandyControl.Controls;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class PinBoxDemoCtl
|
||||
{
|
||||
public PinBoxDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
private void PinBox_OnCompleted(object sender, RoutedEventArgs e)
|
||||
public partial class PinBoxDemoCtl
|
||||
{
|
||||
public PinBoxDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void PinBox_OnCompleted(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is PinBox pinBox)
|
||||
{
|
||||
if (e.OriginalSource is PinBox pinBox)
|
||||
{
|
||||
Growl.Info(pinBox.Password);
|
||||
}
|
||||
Growl.Info(pinBox.Password);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class PoptipDemoCtl
|
||||
{
|
||||
public partial class PoptipDemoCtl
|
||||
public PoptipDemoCtl()
|
||||
{
|
||||
public PoptipDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -1,11 +1,10 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class PreviewSliderDemoCtl
|
||||
{
|
||||
public partial class PreviewSliderDemoCtl
|
||||
public PreviewSliderDemoCtl()
|
||||
{
|
||||
public PreviewSliderDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class ProgressBarDemoCtl
|
||||
{
|
||||
public partial class ProgressBarDemoCtl
|
||||
public ProgressBarDemoCtl()
|
||||
{
|
||||
public ProgressBarDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+52
-53
@@ -2,64 +2,63 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Threading;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class ProgressButtonDemoCtl
|
||||
{
|
||||
public partial class ProgressButtonDemoCtl
|
||||
public static readonly DependencyProperty ProgressProperty = DependencyProperty.Register(
|
||||
"Progress", typeof(int), typeof(ProgressButtonDemoCtl), new PropertyMetadata(default(int)));
|
||||
|
||||
public int Progress
|
||||
{
|
||||
public static readonly DependencyProperty ProgressProperty = DependencyProperty.Register(
|
||||
"Progress", typeof(int), typeof(ProgressButtonDemoCtl), new PropertyMetadata(default(int)));
|
||||
get => (int) GetValue(ProgressProperty);
|
||||
set => SetValue(ProgressProperty, value);
|
||||
}
|
||||
|
||||
public int Progress
|
||||
public static readonly DependencyProperty IsUploadingProperty = DependencyProperty.Register(
|
||||
"IsUploading", typeof(bool), typeof(ProgressButtonDemoCtl), new PropertyMetadata(default(bool)));
|
||||
|
||||
public bool IsUploading
|
||||
{
|
||||
get => (bool) GetValue(IsUploadingProperty);
|
||||
set => SetValue(IsUploadingProperty, value);
|
||||
}
|
||||
|
||||
private readonly DispatcherTimer _timer;
|
||||
|
||||
public ProgressButtonDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
DataContext = this;
|
||||
|
||||
_timer = new DispatcherTimer
|
||||
{
|
||||
get => (int) GetValue(ProgressProperty);
|
||||
set => SetValue(ProgressProperty, value);
|
||||
}
|
||||
Interval = TimeSpan.FromMilliseconds(200)
|
||||
};
|
||||
_timer.Tick += Timer_Tick;
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IsUploadingProperty = DependencyProperty.Register(
|
||||
"IsUploading", typeof(bool), typeof(ProgressButtonDemoCtl), new PropertyMetadata(default(bool)));
|
||||
|
||||
public bool IsUploading
|
||||
private void Timer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
Progress++;
|
||||
if (Progress == 100)
|
||||
{
|
||||
get => (bool) GetValue(IsUploadingProperty);
|
||||
set => SetValue(IsUploadingProperty, value);
|
||||
}
|
||||
|
||||
private readonly DispatcherTimer _timer;
|
||||
|
||||
public ProgressButtonDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
DataContext = this;
|
||||
|
||||
_timer = new DispatcherTimer
|
||||
{
|
||||
Interval = TimeSpan.FromMilliseconds(200)
|
||||
};
|
||||
_timer.Tick += Timer_Tick;
|
||||
}
|
||||
|
||||
private void Timer_Tick(object sender, EventArgs e)
|
||||
{
|
||||
Progress++;
|
||||
if (Progress == 100)
|
||||
{
|
||||
Progress = 0;
|
||||
_timer.Stop();
|
||||
IsUploading = false;
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonProgress_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_timer.IsEnabled)
|
||||
{
|
||||
_timer.Stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
_timer.Start();
|
||||
}
|
||||
Progress = 0;
|
||||
_timer.Stop();
|
||||
IsUploading = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonProgress_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (_timer.IsEnabled)
|
||||
{
|
||||
_timer.Stop();
|
||||
}
|
||||
else
|
||||
{
|
||||
_timer.Start();
|
||||
}
|
||||
}
|
||||
}
|
||||
+23
-24
@@ -1,31 +1,30 @@
|
||||
using System.Windows;
|
||||
using HandyControlDemo.Data;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class PropertyGridDemoCtl
|
||||
{
|
||||
public partial class PropertyGridDemoCtl
|
||||
public PropertyGridDemoCtl()
|
||||
{
|
||||
public PropertyGridDemoCtl()
|
||||
InitializeComponent();
|
||||
|
||||
DemoModel = new PropertyGridDemoModel
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
DemoModel = new PropertyGridDemoModel
|
||||
{
|
||||
String = "TestString",
|
||||
Enum = Gender.Female,
|
||||
Boolean = true,
|
||||
Integer = 98,
|
||||
VerticalAlignment = VerticalAlignment.Stretch
|
||||
};
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty DemoModelProperty = DependencyProperty.Register(
|
||||
"DemoModel", typeof(PropertyGridDemoModel), typeof(PropertyGridDemoCtl), new PropertyMetadata(default(PropertyGridDemoModel)));
|
||||
|
||||
public PropertyGridDemoModel DemoModel
|
||||
{
|
||||
get => (PropertyGridDemoModel) GetValue(DemoModelProperty);
|
||||
set => SetValue(DemoModelProperty, value);
|
||||
}
|
||||
String = "TestString",
|
||||
Enum = Gender.Female,
|
||||
Boolean = true,
|
||||
Integer = 98,
|
||||
VerticalAlignment = VerticalAlignment.Stretch
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty DemoModelProperty = DependencyProperty.Register(
|
||||
"DemoModel", typeof(PropertyGridDemoModel), typeof(PropertyGridDemoCtl), new PropertyMetadata(default(PropertyGridDemoModel)));
|
||||
|
||||
public PropertyGridDemoModel DemoModel
|
||||
{
|
||||
get => (PropertyGridDemoModel) GetValue(DemoModelProperty);
|
||||
set => SetValue(DemoModelProperty, value);
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class RangeSliderDemoCtl
|
||||
{
|
||||
public partial class RangeSliderDemoCtl
|
||||
public RangeSliderDemoCtl()
|
||||
{
|
||||
public RangeSliderDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class RateDemoCtl
|
||||
{
|
||||
public partial class RateDemoCtl
|
||||
public RateDemoCtl()
|
||||
{
|
||||
public RateDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class RelativePanelDemoCtl
|
||||
{
|
||||
public partial class RelativePanelDemoCtl
|
||||
public RelativePanelDemoCtl()
|
||||
{
|
||||
public RelativePanelDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class RunningBlockDemoCtl
|
||||
{
|
||||
public partial class RunningBlockDemoCtl
|
||||
public RunningBlockDemoCtl()
|
||||
{
|
||||
public RunningBlockDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,29 +5,28 @@ using System.Windows.Media;
|
||||
using HandyControl.Controls;
|
||||
using HandyControl.Data;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class ScreenshotDemoCtl : IDisposable
|
||||
{
|
||||
public partial class ScreenshotDemoCtl : IDisposable
|
||||
public ScreenshotDemoCtl()
|
||||
{
|
||||
public ScreenshotDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
Screenshot.Snapped += Screenshot_Snapped;
|
||||
}
|
||||
|
||||
private void Screenshot_Snapped(object sender, FunctionEventArgs<ImageSource> e)
|
||||
{
|
||||
new HandyControl.Controls.Window
|
||||
{
|
||||
Content = new Image
|
||||
{
|
||||
Source = e.Info,
|
||||
Stretch = Stretch.None
|
||||
},
|
||||
WindowStartupLocation = WindowStartupLocation.CenterScreen
|
||||
}.ShowDialog();
|
||||
}
|
||||
|
||||
public void Dispose() => Screenshot.Snapped -= Screenshot_Snapped;
|
||||
InitializeComponent();
|
||||
Screenshot.Snapped += Screenshot_Snapped;
|
||||
}
|
||||
}
|
||||
|
||||
private void Screenshot_Snapped(object sender, FunctionEventArgs<ImageSource> e)
|
||||
{
|
||||
new HandyControl.Controls.Window
|
||||
{
|
||||
Content = new Image
|
||||
{
|
||||
Source = e.Info,
|
||||
Stretch = Stretch.None
|
||||
},
|
||||
WindowStartupLocation = WindowStartupLocation.CenterScreen
|
||||
}.ShowDialog();
|
||||
}
|
||||
|
||||
public void Dispose() => Screenshot.Snapped -= Screenshot_Snapped;
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class ScrollViewerDemoCtl
|
||||
{
|
||||
public partial class ScrollViewerDemoCtl
|
||||
public ScrollViewerDemoCtl()
|
||||
{
|
||||
public ScrollViewerDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class SearchBarDemoCtl
|
||||
{
|
||||
public partial class SearchBarDemoCtl
|
||||
public SearchBarDemoCtl()
|
||||
{
|
||||
public SearchBarDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class ShieldDemoCtl
|
||||
{
|
||||
public partial class ShieldDemoCtl
|
||||
public ShieldDemoCtl()
|
||||
{
|
||||
public ShieldDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class SideMenuDemoCtl
|
||||
{
|
||||
public partial class SideMenuDemoCtl
|
||||
public SideMenuDemoCtl()
|
||||
{
|
||||
public SideMenuDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+12
-13
@@ -1,17 +1,16 @@
|
||||
using System.Windows;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class SplitButtonDemoCtl
|
||||
{
|
||||
public SplitButtonDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MessageBox.Show("123");
|
||||
}
|
||||
public partial class SplitButtonDemoCtl
|
||||
{
|
||||
public SplitButtonDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MessageBox.Show("123");
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class SpriteDemoCtl
|
||||
{
|
||||
public partial class SpriteDemoCtl
|
||||
public SpriteDemoCtl()
|
||||
{
|
||||
public SpriteDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class StepBarDemoCtl
|
||||
{
|
||||
public partial class StepBarDemoCtl
|
||||
public StepBarDemoCtl()
|
||||
{
|
||||
public StepBarDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class TabControlDemoCtl
|
||||
{
|
||||
public partial class TabControlDemoCtl
|
||||
public TabControlDemoCtl()
|
||||
{
|
||||
public TabControlDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class TagDemoCtl
|
||||
{
|
||||
public partial class TagDemoCtl
|
||||
public TagDemoCtl()
|
||||
{
|
||||
public TagDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class TextBoxDemoCtl
|
||||
{
|
||||
public partial class TextBoxDemoCtl
|
||||
public TextBoxDemoCtl()
|
||||
{
|
||||
public TextBoxDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,20 +1,19 @@
|
||||
using System;
|
||||
using HandyControl.Data;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class TimeBarDemoCtl
|
||||
{
|
||||
public TimeBarDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
var hour = 6 * i;
|
||||
TimeBarDemo.Hotspots.Add(new DateTimeRange(DateTime.Today.AddHours(hour), DateTime.Today.AddHours(hour + 1)));
|
||||
TimeBarDemo.Hotspots.Add(new DateTimeRange(DateTime.Today.AddHours(-hour), DateTime.Today.AddHours(-hour + 1)));
|
||||
}
|
||||
public partial class TimeBarDemoCtl
|
||||
{
|
||||
public TimeBarDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
for (int i = 0; i < 10; i++)
|
||||
{
|
||||
var hour = 6 * i;
|
||||
TimeBarDemo.Hotspots.Add(new DateTimeRange(DateTime.Today.AddHours(hour), DateTime.Today.AddHours(hour + 1)));
|
||||
TimeBarDemo.Hotspots.Add(new DateTimeRange(DateTime.Today.AddHours(-hour), DateTime.Today.AddHours(-hour + 1)));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class TimePickerDemoCtl
|
||||
{
|
||||
public partial class TimePickerDemoCtl
|
||||
public TimePickerDemoCtl()
|
||||
{
|
||||
public TimePickerDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class TransferDemoCtl
|
||||
{
|
||||
public partial class TransferDemoCtl
|
||||
public TransferDemoCtl()
|
||||
{
|
||||
public TransferDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class TransitioningContentControlDemoCtl
|
||||
{
|
||||
public partial class TransitioningContentControlDemoCtl
|
||||
public TransitioningContentControlDemoCtl()
|
||||
{
|
||||
public TransitioningContentControlDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class UniformSpacingPanelDemoCtl
|
||||
{
|
||||
public partial class UniformSpacingPanelDemoCtl
|
||||
public UniformSpacingPanelDemoCtl()
|
||||
{
|
||||
public UniformSpacingPanelDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
+6
-7
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class WaterfallPanelDemoCtl
|
||||
{
|
||||
public partial class WaterfallPanelDemoCtl
|
||||
public WaterfallPanelDemoCtl()
|
||||
{
|
||||
public WaterfallPanelDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,61 +4,60 @@ using HandyControl.Data;
|
||||
using HandyControl.Tools;
|
||||
using MessageBox = HandyControl.Controls.MessageBox;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class WindowDemoCtl
|
||||
{
|
||||
public partial class WindowDemoCtl
|
||||
public WindowDemoCtl()
|
||||
{
|
||||
public WindowDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ButtonMessage_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MessageBox.Show(Properties.Langs.Lang.GrowlAsk, Properties.Langs.Lang.Title, MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||
}
|
||||
|
||||
private void ButtonCustomMessage_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MessageBox.Show(new MessageBoxInfo
|
||||
{
|
||||
Message = Properties.Langs.Lang.GrowlAsk,
|
||||
Caption = Properties.Langs.Lang.Title,
|
||||
Button = MessageBoxButton.YesNo,
|
||||
IconBrushKey = ResourceToken.AccentBrush,
|
||||
IconKey = ResourceToken.AskGeometry,
|
||||
StyleKey = "MessageBoxCustom"
|
||||
});
|
||||
}
|
||||
|
||||
private void ButtonMouseFollow_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var picker = SingleOpenHelper.CreateControl<ColorPicker>();
|
||||
var window = new PopupWindow
|
||||
{
|
||||
PopupElement = picker
|
||||
};
|
||||
picker.SelectedColorChanged += delegate { window.Close(); };
|
||||
picker.Canceled += delegate { window.Close(); };
|
||||
window.Show(ButtonMouseFollow, false);
|
||||
}
|
||||
|
||||
private void ButtonCustomContent_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var picker = SingleOpenHelper.CreateControl<ColorPicker>();
|
||||
var window = new PopupWindow
|
||||
{
|
||||
PopupElement = picker,
|
||||
WindowStartupLocation = WindowStartupLocation.CenterScreen,
|
||||
AllowsTransparency = true,
|
||||
WindowStyle = WindowStyle.None,
|
||||
MinWidth = 0,
|
||||
MinHeight = 0,
|
||||
Title = Properties.Langs.Lang.ColorPicker
|
||||
};
|
||||
picker.SelectedColorChanged += delegate { window.Close(); };
|
||||
picker.Canceled += delegate { window.Close(); };
|
||||
window.Show();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonMessage_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MessageBox.Show(Properties.Langs.Lang.GrowlAsk, Properties.Langs.Lang.Title, MessageBoxButton.YesNo, MessageBoxImage.Question);
|
||||
}
|
||||
|
||||
private void ButtonCustomMessage_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
MessageBox.Show(new MessageBoxInfo
|
||||
{
|
||||
Message = Properties.Langs.Lang.GrowlAsk,
|
||||
Caption = Properties.Langs.Lang.Title,
|
||||
Button = MessageBoxButton.YesNo,
|
||||
IconBrushKey = ResourceToken.AccentBrush,
|
||||
IconKey = ResourceToken.AskGeometry,
|
||||
StyleKey = "MessageBoxCustom"
|
||||
});
|
||||
}
|
||||
|
||||
private void ButtonMouseFollow_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var picker = SingleOpenHelper.CreateControl<ColorPicker>();
|
||||
var window = new PopupWindow
|
||||
{
|
||||
PopupElement = picker
|
||||
};
|
||||
picker.SelectedColorChanged += delegate { window.Close(); };
|
||||
picker.Canceled += delegate { window.Close(); };
|
||||
window.Show(ButtonMouseFollow, false);
|
||||
}
|
||||
|
||||
private void ButtonCustomContent_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
var picker = SingleOpenHelper.CreateControl<ColorPicker>();
|
||||
var window = new PopupWindow
|
||||
{
|
||||
PopupElement = picker,
|
||||
WindowStartupLocation = WindowStartupLocation.CenterScreen,
|
||||
AllowsTransparency = true,
|
||||
WindowStyle = WindowStyle.None,
|
||||
MinWidth = 0,
|
||||
MinHeight = 0,
|
||||
Title = Properties.Langs.Lang.ColorPicker
|
||||
};
|
||||
picker.SelectedColorChanged += delegate { window.Close(); };
|
||||
picker.Canceled += delegate { window.Close(); };
|
||||
window.Show();
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class AppNotification
|
||||
{
|
||||
public partial class AppNotification
|
||||
public AppNotification()
|
||||
{
|
||||
public AppNotification()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class AppSprite
|
||||
{
|
||||
public partial class AppSprite
|
||||
public AppSprite()
|
||||
{
|
||||
public AppSprite()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class BlogsView
|
||||
{
|
||||
public partial class BlogsView
|
||||
public BlogsView()
|
||||
{
|
||||
public BlogsView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class ContributorsView
|
||||
{
|
||||
public partial class ContributorsView
|
||||
public ContributorsView()
|
||||
{
|
||||
public ContributorsView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,112 +11,111 @@ using HandyControlDemo.Data;
|
||||
using HandyControlDemo.ViewModel;
|
||||
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
/// <summary>
|
||||
/// 左侧主内容
|
||||
/// </summary>
|
||||
public partial class LeftMainContent
|
||||
{
|
||||
/// <summary>
|
||||
/// 左侧主内容
|
||||
/// </summary>
|
||||
public partial class LeftMainContent
|
||||
private string _searchKey;
|
||||
|
||||
public LeftMainContent()
|
||||
{
|
||||
private string _searchKey;
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
public LeftMainContent()
|
||||
private void TabControl_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (e.AddedItems.Count == 0) return;
|
||||
if (e.AddedItems[0] is DemoInfoModel demoInfo)
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
ViewModelLocator.Instance.Main.DemoInfoCurrent = demoInfo;
|
||||
var selectedIndex = demoInfo.SelectedIndex;
|
||||
demoInfo.SelectedIndex = -1;
|
||||
demoInfo.SelectedIndex = selectedIndex;
|
||||
|
||||
private void TabControl_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (e.AddedItems.Count == 0) return;
|
||||
if (e.AddedItems[0] is DemoInfoModel demoInfo)
|
||||
{
|
||||
ViewModelLocator.Instance.Main.DemoInfoCurrent = demoInfo;
|
||||
var selectedIndex = demoInfo.SelectedIndex;
|
||||
demoInfo.SelectedIndex = -1;
|
||||
demoInfo.SelectedIndex = selectedIndex;
|
||||
|
||||
FilterItems();
|
||||
GroupItems(sender as TabControl, demoInfo);
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonAscending_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is ToggleButton button && button.Tag is ItemsControl itemsControl)
|
||||
{
|
||||
if (button.IsChecked == true)
|
||||
{
|
||||
itemsControl.Items.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
|
||||
}
|
||||
else
|
||||
{
|
||||
itemsControl.Items.SortDescriptions.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SearchBar_OnSearchStarted(object sender, FunctionEventArgs<string> e)
|
||||
{
|
||||
_searchKey = e.Info;
|
||||
FilterItems();
|
||||
GroupItems(sender as TabControl, demoInfo);
|
||||
}
|
||||
}
|
||||
|
||||
private void FilterItems()
|
||||
private void ButtonAscending_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (sender is ToggleButton button && button.Tag is ItemsControl itemsControl)
|
||||
{
|
||||
if (string.IsNullOrEmpty(_searchKey))
|
||||
if (button.IsChecked == true)
|
||||
{
|
||||
foreach (var item in ViewModelLocator.Instance.Main.DemoInfoCurrent.DemoItemList)
|
||||
{
|
||||
item.IsVisible = true;
|
||||
item.QueriesText = string.Empty;
|
||||
}
|
||||
itemsControl.Items.SortDescriptions.Add(new SortDescription("Name", ListSortDirection.Ascending));
|
||||
}
|
||||
else
|
||||
{
|
||||
var key = _searchKey.ToLower();
|
||||
foreach (var item in ViewModelLocator.Instance.Main.DemoInfoCurrent.DemoItemList)
|
||||
itemsControl.Items.SortDescriptions.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SearchBar_OnSearchStarted(object sender, FunctionEventArgs<string> e)
|
||||
{
|
||||
_searchKey = e.Info;
|
||||
FilterItems();
|
||||
}
|
||||
|
||||
private void FilterItems()
|
||||
{
|
||||
if (string.IsNullOrEmpty(_searchKey))
|
||||
{
|
||||
foreach (var item in ViewModelLocator.Instance.Main.DemoInfoCurrent.DemoItemList)
|
||||
{
|
||||
item.IsVisible = true;
|
||||
item.QueriesText = string.Empty;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
var key = _searchKey.ToLower();
|
||||
foreach (var item in ViewModelLocator.Instance.Main.DemoInfoCurrent.DemoItemList)
|
||||
{
|
||||
if (item.Name.ToLower().Contains(key))
|
||||
{
|
||||
if (item.Name.ToLower().Contains(key))
|
||||
{
|
||||
item.IsVisible = true;
|
||||
item.QueriesText = _searchKey;
|
||||
}
|
||||
else if (item.TargetCtlName.Replace("DemoCtl", "").ToLower().Contains(key))
|
||||
item.IsVisible = true;
|
||||
item.QueriesText = _searchKey;
|
||||
}
|
||||
else if (item.TargetCtlName.Replace("DemoCtl", "").ToLower().Contains(key))
|
||||
{
|
||||
item.IsVisible = true;
|
||||
item.QueriesText = _searchKey;
|
||||
}
|
||||
else
|
||||
{
|
||||
var name = Properties.Langs.LangProvider.GetLang(item.Name);
|
||||
if (!string.IsNullOrEmpty(name) && name.ToLower().Contains(key))
|
||||
{
|
||||
item.IsVisible = true;
|
||||
item.QueriesText = _searchKey;
|
||||
}
|
||||
else
|
||||
{
|
||||
var name = Properties.Langs.LangProvider.GetLang(item.Name);
|
||||
if (!string.IsNullOrEmpty(name) && name.ToLower().Contains(key))
|
||||
{
|
||||
item.IsVisible = true;
|
||||
item.QueriesText = _searchKey;
|
||||
}
|
||||
else
|
||||
{
|
||||
item.IsVisible = false;
|
||||
item.QueriesText = string.Empty;
|
||||
}
|
||||
item.IsVisible = false;
|
||||
item.QueriesText = string.Empty;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void GroupItems(TabControl tabControl, DemoInfoModel demoInfo)
|
||||
private void GroupItems(TabControl tabControl, DemoInfoModel demoInfo)
|
||||
{
|
||||
var listBox = VisualHelper.GetChild<ListBox>(tabControl);
|
||||
if (listBox == null) return;
|
||||
listBox.Items.GroupDescriptions?.Clear();
|
||||
|
||||
if (demoInfo.IsGroupEnabled)
|
||||
{
|
||||
var listBox = VisualHelper.GetChild<ListBox>(tabControl);
|
||||
if (listBox == null) return;
|
||||
listBox.Items.GroupDescriptions?.Clear();
|
||||
|
||||
if (demoInfo.IsGroupEnabled)
|
||||
Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
Dispatcher.BeginInvoke(new Action(() =>
|
||||
{
|
||||
listBox.Items.GroupDescriptions?.Add(new PropertyGroupDescription("GroupName"));
|
||||
}), DispatcherPriority.Background);
|
||||
}
|
||||
listBox.Items.GroupDescriptions?.Add(new PropertyGroupDescription("GroupName"));
|
||||
}), DispatcherPriority.Background);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -11,173 +11,172 @@ using HandyControlDemo.ViewModel;
|
||||
using ICSharpCode.AvalonEdit;
|
||||
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
/// <summary>
|
||||
/// 主内容
|
||||
/// </summary>
|
||||
public partial class MainContent
|
||||
{
|
||||
/// <summary>
|
||||
/// 主内容
|
||||
/// </summary>
|
||||
public partial class MainContent
|
||||
private bool _isFull;
|
||||
|
||||
private string _currentDemoKey;
|
||||
|
||||
private bool _drawerCodeUsed;
|
||||
|
||||
private Dictionary<string, TextEditor> _textEditor;
|
||||
|
||||
public MainContent()
|
||||
{
|
||||
private bool _isFull;
|
||||
InitializeComponent();
|
||||
|
||||
private string _currentDemoKey;
|
||||
Messenger.Default.Register<bool>(this, MessageToken.FullSwitch, FullSwitch);
|
||||
Messenger.Default.Register<SkinType>(this, MessageToken.SkinUpdated, SkinUpdated);
|
||||
}
|
||||
|
||||
private bool _drawerCodeUsed;
|
||||
|
||||
private Dictionary<string, TextEditor> _textEditor;
|
||||
|
||||
public MainContent()
|
||||
private void FullSwitch(bool isFull)
|
||||
{
|
||||
if (_isFull == isFull)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
Messenger.Default.Register<bool>(this, MessageToken.FullSwitch, FullSwitch);
|
||||
Messenger.Default.Register<SkinType>(this, MessageToken.SkinUpdated, SkinUpdated);
|
||||
return;
|
||||
}
|
||||
|
||||
private void FullSwitch(bool isFull)
|
||||
_isFull = isFull;
|
||||
|
||||
if (_isFull)
|
||||
{
|
||||
if (_isFull == isFull)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_isFull = isFull;
|
||||
|
||||
if (_isFull)
|
||||
{
|
||||
BorderRootEffect.Show();
|
||||
BorderEffect.Collapse();
|
||||
BorderTitle.Collapse();
|
||||
GridMain.HorizontalAlignment = HorizontalAlignment.Stretch;
|
||||
GridMain.VerticalAlignment = VerticalAlignment.Stretch;
|
||||
PresenterMain.Margin = new Thickness();
|
||||
BorderRoot.CornerRadius = new CornerRadius(10);
|
||||
BorderRoot.Style = ResourceHelper.GetResource<Style>("BorderClip");
|
||||
}
|
||||
else
|
||||
{
|
||||
BorderRootEffect.Collapse();
|
||||
BorderEffect.Show();
|
||||
BorderTitle.Show();
|
||||
GridMain.HorizontalAlignment = HorizontalAlignment.Center;
|
||||
GridMain.VerticalAlignment = VerticalAlignment.Center;
|
||||
PresenterMain.Margin = new Thickness(0, 0, 0, 10);
|
||||
BorderRoot.CornerRadius = new CornerRadius();
|
||||
BorderRoot.Style = null;
|
||||
}
|
||||
BorderRootEffect.Show();
|
||||
BorderEffect.Collapse();
|
||||
BorderTitle.Collapse();
|
||||
GridMain.HorizontalAlignment = HorizontalAlignment.Stretch;
|
||||
GridMain.VerticalAlignment = VerticalAlignment.Stretch;
|
||||
PresenterMain.Margin = new Thickness();
|
||||
BorderRoot.CornerRadius = new CornerRadius(10);
|
||||
BorderRoot.Style = ResourceHelper.GetResource<Style>("BorderClip");
|
||||
}
|
||||
|
||||
private void SkinUpdated(SkinType skinType)
|
||||
else
|
||||
{
|
||||
if (!_drawerCodeUsed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_textEditor[ConstString.Xaml].SyntaxHighlighting = HighlightingProvider.GetDefinition(skinType, ConstString.Xml);
|
||||
_textEditor[ConstString.Cs].SyntaxHighlighting = HighlightingProvider.GetDefinition(skinType, ConstString.Cs);
|
||||
_textEditor[ConstString.Vm].SyntaxHighlighting = HighlightingProvider.GetDefinition(skinType, ConstString.Cs);
|
||||
}
|
||||
|
||||
private void InitTextEditor()
|
||||
{
|
||||
HighlightingProvider.Register(SkinType.Default, HighlightingProvider.Default);
|
||||
HighlightingProvider.Register(SkinType.Dark, new HighlightingProviderDark());
|
||||
HighlightingProvider.Register(SkinType.Violet, HighlightingProvider.Default);
|
||||
|
||||
var textEditorCustomStyle = ResourceHelper.GetResource<Style>("TextEditorCustom");
|
||||
var skinType = GlobalData.Config.Skin;
|
||||
|
||||
_textEditor = new Dictionary<string, TextEditor>
|
||||
{
|
||||
[ConstString.Xaml] = new()
|
||||
{
|
||||
Style = textEditorCustomStyle,
|
||||
SyntaxHighlighting = HighlightingProvider.GetDefinition(skinType, ConstString.Xml)
|
||||
},
|
||||
[ConstString.Cs] = new()
|
||||
{
|
||||
Style = textEditorCustomStyle,
|
||||
SyntaxHighlighting = HighlightingProvider.GetDefinition(skinType, ConstString.Cs)
|
||||
},
|
||||
[ConstString.Vm] = new()
|
||||
{
|
||||
Style = textEditorCustomStyle,
|
||||
SyntaxHighlighting = HighlightingProvider.GetDefinition(skinType, ConstString.Cs)
|
||||
}
|
||||
};
|
||||
|
||||
BorderCode.Child = new TabControl
|
||||
{
|
||||
Style = ResourceHelper.GetResource<Style>("TabControlInLine"),
|
||||
Items =
|
||||
{
|
||||
new TabItem
|
||||
{
|
||||
Header = ConstString.Xaml,
|
||||
Content = _textEditor[ConstString.Xaml]
|
||||
},
|
||||
new TabItem
|
||||
{
|
||||
Header = ConstString.Cs,
|
||||
Content = _textEditor[ConstString.Cs]
|
||||
},
|
||||
new TabItem
|
||||
{
|
||||
Header = ConstString.Vm,
|
||||
Content = _textEditor[ConstString.Vm]
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void UpdateTextEditor()
|
||||
{
|
||||
var typeKey = ViewModelLocator.Instance.Main.DemoInfoCurrent.Key;
|
||||
var demoKey = ViewModelLocator.Instance.Main.DemoItemCurrent.TargetCtlName;
|
||||
if (Equals(_currentDemoKey, demoKey))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_currentDemoKey = demoKey;
|
||||
|
||||
if (ViewModelLocator.Instance.Main.SubContent is FrameworkElement demoCtl)
|
||||
{
|
||||
var demoCtlTypeName = demoCtl.GetType().Name;
|
||||
var xamlPath = $"UserControl/{typeKey}/{demoCtlTypeName}.xaml";
|
||||
var dc = demoCtl.DataContext;
|
||||
var dcTypeName = dc.GetType().Name;
|
||||
var vmPath = !Equals(dcTypeName, demoCtlTypeName)
|
||||
? $"ViewModel/{dcTypeName}"
|
||||
: xamlPath;
|
||||
|
||||
_textEditor[ConstString.Xaml].Text = DemoHelper.GetCode(xamlPath);
|
||||
_textEditor[ConstString.Cs].Text = DemoHelper.GetCode($"{xamlPath}.cs");
|
||||
_textEditor[ConstString.Vm].Text = DemoHelper.GetCode($"{vmPath}.cs");
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawerCode_OnOpened(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_drawerCodeUsed)
|
||||
{
|
||||
InitTextEditor();
|
||||
_drawerCodeUsed = true;
|
||||
}
|
||||
|
||||
UpdateTextEditor();
|
||||
}
|
||||
|
||||
private static class ConstString
|
||||
{
|
||||
public const string Xaml = "XAML";
|
||||
|
||||
public const string Vm = "VM";
|
||||
|
||||
public const string Cs = "C#";
|
||||
|
||||
public const string Xml = "XML";
|
||||
BorderRootEffect.Collapse();
|
||||
BorderEffect.Show();
|
||||
BorderTitle.Show();
|
||||
GridMain.HorizontalAlignment = HorizontalAlignment.Center;
|
||||
GridMain.VerticalAlignment = VerticalAlignment.Center;
|
||||
PresenterMain.Margin = new Thickness(0, 0, 0, 10);
|
||||
BorderRoot.CornerRadius = new CornerRadius();
|
||||
BorderRoot.Style = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void SkinUpdated(SkinType skinType)
|
||||
{
|
||||
if (!_drawerCodeUsed)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_textEditor[ConstString.Xaml].SyntaxHighlighting = HighlightingProvider.GetDefinition(skinType, ConstString.Xml);
|
||||
_textEditor[ConstString.Cs].SyntaxHighlighting = HighlightingProvider.GetDefinition(skinType, ConstString.Cs);
|
||||
_textEditor[ConstString.Vm].SyntaxHighlighting = HighlightingProvider.GetDefinition(skinType, ConstString.Cs);
|
||||
}
|
||||
|
||||
private void InitTextEditor()
|
||||
{
|
||||
HighlightingProvider.Register(SkinType.Default, HighlightingProvider.Default);
|
||||
HighlightingProvider.Register(SkinType.Dark, new HighlightingProviderDark());
|
||||
HighlightingProvider.Register(SkinType.Violet, HighlightingProvider.Default);
|
||||
|
||||
var textEditorCustomStyle = ResourceHelper.GetResource<Style>("TextEditorCustom");
|
||||
var skinType = GlobalData.Config.Skin;
|
||||
|
||||
_textEditor = new Dictionary<string, TextEditor>
|
||||
{
|
||||
[ConstString.Xaml] = new()
|
||||
{
|
||||
Style = textEditorCustomStyle,
|
||||
SyntaxHighlighting = HighlightingProvider.GetDefinition(skinType, ConstString.Xml)
|
||||
},
|
||||
[ConstString.Cs] = new()
|
||||
{
|
||||
Style = textEditorCustomStyle,
|
||||
SyntaxHighlighting = HighlightingProvider.GetDefinition(skinType, ConstString.Cs)
|
||||
},
|
||||
[ConstString.Vm] = new()
|
||||
{
|
||||
Style = textEditorCustomStyle,
|
||||
SyntaxHighlighting = HighlightingProvider.GetDefinition(skinType, ConstString.Cs)
|
||||
}
|
||||
};
|
||||
|
||||
BorderCode.Child = new TabControl
|
||||
{
|
||||
Style = ResourceHelper.GetResource<Style>("TabControlInLine"),
|
||||
Items =
|
||||
{
|
||||
new TabItem
|
||||
{
|
||||
Header = ConstString.Xaml,
|
||||
Content = _textEditor[ConstString.Xaml]
|
||||
},
|
||||
new TabItem
|
||||
{
|
||||
Header = ConstString.Cs,
|
||||
Content = _textEditor[ConstString.Cs]
|
||||
},
|
||||
new TabItem
|
||||
{
|
||||
Header = ConstString.Vm,
|
||||
Content = _textEditor[ConstString.Vm]
|
||||
}
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
private void UpdateTextEditor()
|
||||
{
|
||||
var typeKey = ViewModelLocator.Instance.Main.DemoInfoCurrent.Key;
|
||||
var demoKey = ViewModelLocator.Instance.Main.DemoItemCurrent.TargetCtlName;
|
||||
if (Equals(_currentDemoKey, demoKey))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_currentDemoKey = demoKey;
|
||||
|
||||
if (ViewModelLocator.Instance.Main.SubContent is FrameworkElement demoCtl)
|
||||
{
|
||||
var demoCtlTypeName = demoCtl.GetType().Name;
|
||||
var xamlPath = $"UserControl/{typeKey}/{demoCtlTypeName}.xaml";
|
||||
var dc = demoCtl.DataContext;
|
||||
var dcTypeName = dc.GetType().Name;
|
||||
var vmPath = !Equals(dcTypeName, demoCtlTypeName)
|
||||
? $"ViewModel/{dcTypeName}"
|
||||
: xamlPath;
|
||||
|
||||
_textEditor[ConstString.Xaml].Text = DemoHelper.GetCode(xamlPath);
|
||||
_textEditor[ConstString.Cs].Text = DemoHelper.GetCode($"{xamlPath}.cs");
|
||||
_textEditor[ConstString.Vm].Text = DemoHelper.GetCode($"{vmPath}.cs");
|
||||
}
|
||||
}
|
||||
|
||||
private void DrawerCode_OnOpened(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (!_drawerCodeUsed)
|
||||
{
|
||||
InitTextEditor();
|
||||
_drawerCodeUsed = true;
|
||||
}
|
||||
|
||||
UpdateTextEditor();
|
||||
}
|
||||
|
||||
private static class ConstString
|
||||
{
|
||||
public const string Xaml = "XAML";
|
||||
|
||||
public const string Vm = "VM";
|
||||
|
||||
public const string Cs = "C#";
|
||||
|
||||
public const string Xml = "XML";
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class MainWindowContent
|
||||
{
|
||||
public partial class MainWindowContent
|
||||
public MainWindowContent()
|
||||
{
|
||||
public MainWindowContent()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -8,59 +8,58 @@ using HandyControlDemo.Data;
|
||||
using HandyControlDemo.Properties.Langs;
|
||||
using HandyControlDemo.Window;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class NonClientAreaContent
|
||||
{
|
||||
public partial class NonClientAreaContent
|
||||
public NonClientAreaContent()
|
||||
{
|
||||
public NonClientAreaContent()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
|
||||
private void ButtonLangs_OnClick(object sender, RoutedEventArgs e)
|
||||
private void ButtonLangs_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is Button { Tag: string langName })
|
||||
{
|
||||
if (e.OriginalSource is Button { Tag: string langName })
|
||||
PopupConfig.IsOpen = false;
|
||||
if (langName.Equals(GlobalData.Config.Lang))
|
||||
{
|
||||
PopupConfig.IsOpen = false;
|
||||
if (langName.Equals(GlobalData.Config.Lang))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ConfigHelper.Instance.SetLang(langName);
|
||||
LangProvider.Culture = new CultureInfo(langName);
|
||||
Messenger.Default.Send<object>(null, MessageToken.LangUpdated);
|
||||
|
||||
GlobalData.Config.Lang = langName;
|
||||
GlobalData.Save();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonConfig_OnClick(object sender, RoutedEventArgs e) => PopupConfig.IsOpen = true;
|
||||
ConfigHelper.Instance.SetLang(langName);
|
||||
LangProvider.Culture = new CultureInfo(langName);
|
||||
Messenger.Default.Send<object>(null, MessageToken.LangUpdated);
|
||||
|
||||
private void ButtonSkins_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is Button { Tag: SkinType skinType })
|
||||
{
|
||||
PopupConfig.IsOpen = false;
|
||||
if (skinType.Equals(GlobalData.Config.Skin))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GlobalData.Config.Skin = skinType;
|
||||
GlobalData.Save();
|
||||
((App) Application.Current).UpdateSkin(skinType);
|
||||
Messenger.Default.Send(skinType, MessageToken.SkinUpdated);
|
||||
}
|
||||
}
|
||||
|
||||
private void MenuAbout_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
new AboutWindow
|
||||
{
|
||||
Owner = Application.Current.MainWindow
|
||||
}.ShowDialog();
|
||||
GlobalData.Config.Lang = langName;
|
||||
GlobalData.Save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void ButtonConfig_OnClick(object sender, RoutedEventArgs e) => PopupConfig.IsOpen = true;
|
||||
|
||||
private void ButtonSkins_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is Button { Tag: SkinType skinType })
|
||||
{
|
||||
PopupConfig.IsOpen = false;
|
||||
if (skinType.Equals(GlobalData.Config.Skin))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
GlobalData.Config.Skin = skinType;
|
||||
GlobalData.Save();
|
||||
((App) Application.Current).UpdateSkin(skinType);
|
||||
Messenger.Default.Send(skinType, MessageToken.SkinUpdated);
|
||||
}
|
||||
}
|
||||
|
||||
private void MenuAbout_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
new AboutWindow
|
||||
{
|
||||
Owner = Application.Current.MainWindow
|
||||
}.ShowDialog();
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class PracticalDemo
|
||||
{
|
||||
public partial class PracticalDemo
|
||||
public PracticalDemo()
|
||||
{
|
||||
public PracticalDemo()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class ProjectsView
|
||||
{
|
||||
public partial class ProjectsView
|
||||
public ProjectsView()
|
||||
{
|
||||
public ProjectsView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class UnderConstruction
|
||||
{
|
||||
public partial class UnderConstruction
|
||||
public UnderConstruction()
|
||||
{
|
||||
public UnderConstruction()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class WebsitesView
|
||||
{
|
||||
public partial class WebsitesView
|
||||
public WebsitesView()
|
||||
{
|
||||
public WebsitesView()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class Login
|
||||
{
|
||||
public partial class Login
|
||||
public Login()
|
||||
{
|
||||
public Login()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class BorderDemoCtl
|
||||
{
|
||||
public partial class BorderDemoCtl
|
||||
public BorderDemoCtl()
|
||||
{
|
||||
public BorderDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class BrushDemoCtl
|
||||
{
|
||||
public partial class BrushDemoCtl
|
||||
public BrushDemoCtl()
|
||||
{
|
||||
public BrushDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class ButtonDemoCtl
|
||||
{
|
||||
public partial class ButtonDemoCtl
|
||||
public ButtonDemoCtl()
|
||||
{
|
||||
public ButtonDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class CalendarDemoCtl
|
||||
{
|
||||
public partial class CalendarDemoCtl
|
||||
public CalendarDemoCtl()
|
||||
{
|
||||
public CalendarDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class CheckBoxDemoCtl
|
||||
{
|
||||
public partial class CheckBoxDemoCtl
|
||||
public CheckBoxDemoCtl()
|
||||
{
|
||||
public CheckBoxDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,11 +1,10 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class DataGridDemoCtl
|
||||
{
|
||||
public partial class DataGridDemoCtl
|
||||
public DataGridDemoCtl()
|
||||
{
|
||||
public DataGridDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,12 +1,11 @@
|
||||
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class ExpanderDemoCtl
|
||||
{
|
||||
public partial class ExpanderDemoCtl
|
||||
public ExpanderDemoCtl()
|
||||
{
|
||||
public ExpanderDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,10 +1,9 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class FlowDocumentDemoCtl
|
||||
{
|
||||
public partial class FlowDocumentDemoCtl
|
||||
public FlowDocumentDemoCtl()
|
||||
{
|
||||
public FlowDocumentDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -4,54 +4,53 @@ using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using HandyControl.Tools.Extension;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class FrameDemoCtl
|
||||
{
|
||||
public partial class FrameDemoCtl
|
||||
|
||||
private readonly List<Page> _pageList;
|
||||
|
||||
public FrameDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
private readonly List<Page> _pageList;
|
||||
AddHandler(ButtonBase.ClickEvent, new RoutedEventHandler(Button_Click));
|
||||
|
||||
public FrameDemoCtl()
|
||||
_pageList = new List<Page>();
|
||||
for (var i = 0; i < 5; i++)
|
||||
{
|
||||
InitializeComponent();
|
||||
|
||||
AddHandler(ButtonBase.ClickEvent, new RoutedEventHandler(Button_Click));
|
||||
|
||||
_pageList = new List<Page>();
|
||||
for (var i = 0; i < 5; i++)
|
||||
{
|
||||
_pageList.Add(CreatePage(i));
|
||||
}
|
||||
|
||||
FrameDemo.Navigate(_pageList[0]);
|
||||
_pageList.Add(CreatePage(i));
|
||||
}
|
||||
|
||||
private Page CreatePage(int index)
|
||||
{
|
||||
var indexStr = index.ToString();
|
||||
var button = new Button
|
||||
{
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
Content = indexStr,
|
||||
Width = 320,
|
||||
Tag = indexStr
|
||||
};
|
||||
FrameDemo.Navigate(_pageList[0]);
|
||||
}
|
||||
|
||||
return new Page
|
||||
{
|
||||
Title = indexStr,
|
||||
Content = button
|
||||
};
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
private Page CreatePage(int index)
|
||||
{
|
||||
var indexStr = index.ToString();
|
||||
var button = new Button
|
||||
{
|
||||
if (e.OriginalSource is Button button && button.Tag is string tag)
|
||||
{
|
||||
var index = tag.Value<int>() + 1;
|
||||
FrameDemo.Navigate(index >= _pageList.Count ? _pageList[0] : _pageList[index]);
|
||||
}
|
||||
HorizontalAlignment = HorizontalAlignment.Center,
|
||||
VerticalAlignment = VerticalAlignment.Center,
|
||||
Content = indexStr,
|
||||
Width = 320,
|
||||
Tag = indexStr
|
||||
};
|
||||
|
||||
return new Page
|
||||
{
|
||||
Title = indexStr,
|
||||
Content = button
|
||||
};
|
||||
}
|
||||
|
||||
private void Button_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e.OriginalSource is Button button && button.Tag is string tag)
|
||||
{
|
||||
var index = tag.Value<int>() + 1;
|
||||
FrameDemo.Navigate(index >= _pageList.Count ? _pageList[0] : _pageList[index]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -6,36 +6,35 @@ using System.Windows.Media;
|
||||
using HandyControl.Tools;
|
||||
using HandyControlDemo.Data;
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl;
|
||||
|
||||
public partial class GeometryDemoCtl
|
||||
{
|
||||
public partial class GeometryDemoCtl
|
||||
private readonly HashSet<string> _lineSet = new()
|
||||
{
|
||||
private readonly HashSet<string> _lineSet = new()
|
||||
{
|
||||
"CheckedGeometry"
|
||||
};
|
||||
"CheckedGeometry"
|
||||
};
|
||||
|
||||
public ObservableCollection<GeometryItemModel> GeometryItems { get; set; } =
|
||||
new();
|
||||
public ObservableCollection<GeometryItemModel> GeometryItems { get; set; } =
|
||||
new();
|
||||
|
||||
public GeometryDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
GenerateGeometries();
|
||||
}
|
||||
public GeometryDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
GenerateGeometries();
|
||||
}
|
||||
|
||||
public void GenerateGeometries()
|
||||
public void GenerateGeometries()
|
||||
{
|
||||
foreach (var key in Application.Current.Resources.MergedDictionaries[1].MergedDictionaries[0].Keys.OfType<string>().OrderBy(item => item))
|
||||
{
|
||||
foreach (var key in Application.Current.Resources.MergedDictionaries[1].MergedDictionaries[0].Keys.OfType<string>().OrderBy(item => item))
|
||||
if (!key.EndsWith("Geometry")) continue;
|
||||
GeometryItems.Add(new GeometryItemModel
|
||||
{
|
||||
if (!key.EndsWith("Geometry")) continue;
|
||||
GeometryItems.Add(new GeometryItemModel
|
||||
{
|
||||
Key = key,
|
||||
Data = ResourceHelper.GetResource<Geometry>(key),
|
||||
Line = _lineSet.Contains(key)
|
||||
});
|
||||
}
|
||||
Key = key,
|
||||
Data = ResourceHelper.GetResource<Geometry>(key),
|
||||
Line = _lineSet.Contains(key)
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Loaded 100 of 748 files, more files were not shown because too many files have changed in this diff.
Show more
Reference in new issue
Block a user