diff --git a/ChangeLog.txt b/ChangeLog.txt index 796b7fc2..b9863c8d 100644 --- a/ChangeLog.txt +++ b/ChangeLog.txt @@ -1,3 +1,15 @@ +2018.10.09 Version 1.3.1 +* new style + - add TextBox + - add ComboBox + - add PasswordBox + - add DataPicker + - add TimePicker + +* other + - add TextBlockDemo + - add CirclePanelDemo + 2018.10.03 Version 1.3.0 * new controls - add Clock diff --git a/HandyControl/Controls/Attach/BackgroundSwitchElement.cs b/HandyControl/Controls/Attach/BackgroundSwitchElement.cs index 1711f7d8..09da3666 100644 --- a/HandyControl/Controls/Attach/BackgroundSwitchElement.cs +++ b/HandyControl/Controls/Attach/BackgroundSwitchElement.cs @@ -7,29 +7,17 @@ namespace HandyControl.Controls public class BackgroundSwitchElement : DependencyObject { public static readonly DependencyProperty MouseHoverBackgroundProperty = DependencyProperty.RegisterAttached( - "MouseHoverBackground", typeof(Brush), typeof(BackgroundSwitchElement), new PropertyMetadata(Brushes.Transparent)); + "MouseHoverBackground", typeof(Brush), typeof(BackgroundSwitchElement), new FrameworkPropertyMetadata(Brushes.Transparent, FrameworkPropertyMetadataOptions.Inherits)); - public static void SetMouseHoverBackground(DependencyObject element, Brush value) - { - element.SetValue(MouseHoverBackgroundProperty, value); - } + public static void SetMouseHoverBackground(DependencyObject element, Brush value) => element.SetValue(MouseHoverBackgroundProperty, value); - public static Brush GetMouseHoverBackground(DependencyObject element) - { - return (Brush)element.GetValue(MouseHoverBackgroundProperty); - } + public static Brush GetMouseHoverBackground(DependencyObject element) => (Brush)element.GetValue(MouseHoverBackgroundProperty); public static readonly DependencyProperty MouseDownBackgroundProperty = DependencyProperty.RegisterAttached( - "MouseDownBackground", typeof(Brush), typeof(BackgroundSwitchElement), new PropertyMetadata(Brushes.Transparent)); + "MouseDownBackground", typeof(Brush), typeof(BackgroundSwitchElement), new FrameworkPropertyMetadata(Brushes.Transparent, FrameworkPropertyMetadataOptions.Inherits)); - public static void SetMouseDownBackground(DependencyObject element, Brush value) - { - element.SetValue(MouseDownBackgroundProperty, value); - } + public static void SetMouseDownBackground(DependencyObject element, Brush value) => element.SetValue(MouseDownBackgroundProperty, value); - public static Brush GetMouseDownBackground(DependencyObject element) - { - return (Brush)element.GetValue(MouseDownBackgroundProperty); - } + public static Brush GetMouseDownBackground(DependencyObject element) => (Brush)element.GetValue(MouseDownBackgroundProperty); } } \ No newline at end of file diff --git a/HandyControl/Controls/Attach/BorderElement.cs b/HandyControl/Controls/Attach/BorderElement.cs index 77b24384..8868c3c2 100644 --- a/HandyControl/Controls/Attach/BorderElement.cs +++ b/HandyControl/Controls/Attach/BorderElement.cs @@ -6,16 +6,10 @@ namespace HandyControl.Controls public class BorderElement : DependencyObject { public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.RegisterAttached( - "CornerRadius", typeof(CornerRadius), typeof(BorderElement), new PropertyMetadata(default(CornerRadius))); + "CornerRadius", typeof(CornerRadius), typeof(BorderElement), new FrameworkPropertyMetadata(default(CornerRadius), FrameworkPropertyMetadataOptions.Inherits)); - public static void SetCornerRadius(DependencyObject element, CornerRadius value) - { - element.SetValue(CornerRadiusProperty, value); - } + public static void SetCornerRadius(DependencyObject element, CornerRadius value) => element.SetValue(CornerRadiusProperty, value); - public static CornerRadius GetCornerRadius(DependencyObject element) - { - return (CornerRadius) element.GetValue(CornerRadiusProperty); - } + public static CornerRadius GetCornerRadius(DependencyObject element) => (CornerRadius)element.GetValue(CornerRadiusProperty); } } \ No newline at end of file diff --git a/HandyControl/Controls/Attach/InfoElement.cs b/HandyControl/Controls/Attach/InfoElement.cs index 4af45fa7..04df5f96 100644 --- a/HandyControl/Controls/Attach/InfoElement.cs +++ b/HandyControl/Controls/Attach/InfoElement.cs @@ -6,6 +6,9 @@ namespace HandyControl.Controls { public class InfoElement : DependencyObject { + /// + /// 标题 + /// public static readonly DependencyProperty TitleProperty = DependencyProperty.RegisterAttached( "Title", typeof(string), typeof(InfoElement), new PropertyMetadata(default(string))); @@ -13,18 +16,54 @@ namespace HandyControl.Controls public static string GetTitle(DependencyObject element) => (string) element.GetValue(TitleProperty); - public static readonly DependencyProperty RequiredProperty = DependencyProperty.RegisterAttached( - "Required", typeof(bool), typeof(InfoElement), new PropertyMetadata(default(bool))); + /// + /// 占位符 + /// + public static readonly DependencyProperty PlaceholderProperty = DependencyProperty.RegisterAttached( + "Placeholder", typeof(string), typeof(InfoElement), new PropertyMetadata(default(string))); - public static void SetRequired(DependencyObject element, bool value) => element.SetValue(RequiredProperty, value); + public static void SetPlaceholder(DependencyObject element, string value) => element.SetValue(PlaceholderProperty, value); - public static bool GetRequired(DependencyObject element) => (bool)element.GetValue(RequiredProperty); + public static string GetPlaceholder(DependencyObject element) => (string)element.GetValue(PlaceholderProperty); + /// + /// 是否必填 + /// + public static readonly DependencyProperty NecessaryProperty = DependencyProperty.RegisterAttached( + "Necessary", typeof(bool), typeof(InfoElement), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.Inherits)); + + public static void SetNecessary(DependencyObject element, bool value) => element.SetValue(NecessaryProperty, value); + + public static bool GetNecessary(DependencyObject element) => (bool)element.GetValue(NecessaryProperty); + + /// + /// 标记 + /// + public static readonly DependencyProperty SymbolProperty = DependencyProperty.RegisterAttached( + "Symbol", typeof(string), typeof(InfoElement), new FrameworkPropertyMetadata(default(string), FrameworkPropertyMetadataOptions.Inherits)); + + public static void SetSymbol(DependencyObject element, string value) => element.SetValue(SymbolProperty, value); + + public static string GetSymbol(DependencyObject element) => (string)element.GetValue(SymbolProperty); + + /// + /// 标题对齐方式 + /// public static readonly DependencyProperty TitleAlignmentProperty = DependencyProperty.RegisterAttached( - "TitleAlignment", typeof(TitleAlignment), typeof(InfoElement), new PropertyMetadata(default(TitleAlignment))); + "TitleAlignment", typeof(TitleAlignment), typeof(InfoElement), new FrameworkPropertyMetadata(TitleAlignment.Top, FrameworkPropertyMetadataOptions.Inherits)); public static void SetTitleAlignment(DependencyObject element, TitleAlignment value) => element.SetValue(TitleAlignmentProperty, value); public static TitleAlignment GetTitleAlignment(DependencyObject element) => (TitleAlignment) element.GetValue(TitleAlignmentProperty); + + /// + /// 标题宽度 + /// + public static readonly DependencyProperty TitleWidthProperty = DependencyProperty.RegisterAttached( + "TitleWidth", typeof(GridLength), typeof(InfoElement), new FrameworkPropertyMetadata(new GridLength(120.0), FrameworkPropertyMetadataOptions.Inherits)); + + public static void SetTitleWidth(DependencyObject element, GridLength value) => element.SetValue(TitleWidthProperty, value); + + public static GridLength GetTitleWidth(DependencyObject element) => (GridLength)element.GetValue(TitleWidthProperty); } } \ No newline at end of file diff --git a/HandyControl/Controls/Attach/PasswordBoxMonitor.cs b/HandyControl/Controls/Attach/PasswordBoxMonitor.cs new file mode 100644 index 00000000..e1d3d6e4 --- /dev/null +++ b/HandyControl/Controls/Attach/PasswordBoxMonitor.cs @@ -0,0 +1,55 @@ +using System.Windows; +using System.Windows.Controls; + +// ReSharper disable once CheckNamespace +namespace HandyControl.Controls +{ + public class PasswordBoxMonitor + { + /// + /// 密码长度 + /// + public static readonly DependencyProperty PasswordLengthProperty = DependencyProperty.RegisterAttached( + "PasswordLength", typeof(int), typeof(PasswordBoxMonitor), new PropertyMetadata(default(int))); + + public static void SetPasswordLength(DependencyObject element, int value) => element.SetValue(PasswordLengthProperty, value); + + public static int GetPasswordLength(DependencyObject element) => (int)element.GetValue(PasswordLengthProperty); + + /// + /// 是否监测 + /// + public static readonly DependencyProperty IsMonitoringProperty = DependencyProperty.RegisterAttached( + "IsMonitoring", typeof(bool), typeof(PasswordBoxMonitor), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.Inherits, OnIsMonitoringChanged)); + + private static void OnIsMonitoringChanged(DependencyObject d, DependencyPropertyChangedEventArgs e) + { + if (d is PasswordBox passwordBox) + { + if (e.NewValue is bool boolValue) + { + if (boolValue) + { + passwordBox.PasswordChanged += PasswordChanged; + } + else + { + passwordBox.PasswordChanged -= PasswordChanged; + } + } + } + } + + public static void SetIsMonitoring(DependencyObject element, bool value) => element.SetValue(IsMonitoringProperty, value); + + public static bool GetIsMonitoring(DependencyObject element) => (bool)element.GetValue(IsMonitoringProperty); + + private static void PasswordChanged(object sender, RoutedEventArgs e) + { + if (sender is PasswordBox passwordBox) + { + SetPasswordLength(passwordBox, passwordBox.Password.Length); + } + } + } +} \ No newline at end of file diff --git a/HandyControl/Controls/CirclePanel.cs b/HandyControl/Controls/CirclePanel.cs index ad766636..c90fb7ae 100644 --- a/HandyControl/Controls/CirclePanel.cs +++ b/HandyControl/Controls/CirclePanel.cs @@ -8,7 +8,7 @@ namespace HandyControl.Controls public class CirclePanel : Panel { public static readonly DependencyProperty DiameterProperty = DependencyProperty.Register( - "Diameter", typeof(double), typeof(CirclePanel), new PropertyMetadata(170.0)); + "Diameter", typeof(double), typeof(CirclePanel), new FrameworkPropertyMetadata(170.0, FrameworkPropertyMetadataOptions.AffectsMeasure)); public double Diameter { @@ -17,7 +17,7 @@ namespace HandyControl.Controls } public static readonly DependencyProperty KeepVerticalProperty = DependencyProperty.Register( - "KeepVertical", typeof(bool), typeof(CirclePanel), new PropertyMetadata(default(bool))); + "KeepVertical", typeof(bool), typeof(CirclePanel), new FrameworkPropertyMetadata(default(bool), FrameworkPropertyMetadataOptions.AffectsMeasure)); public bool KeepVertical { @@ -26,7 +26,7 @@ namespace HandyControl.Controls } public static readonly DependencyProperty OffsetAngleProperty = DependencyProperty.Register( - "OffsetAngle", typeof(double), typeof(CirclePanel), new PropertyMetadata(default(double))); + "OffsetAngle", typeof(double), typeof(CirclePanel), new FrameworkPropertyMetadata(default(double), FrameworkPropertyMetadataOptions.AffectsMeasure)); public double OffsetAngle { diff --git a/HandyControl/HandyControl.csproj b/HandyControl/HandyControl.csproj index 90ef9689..34c77692 100644 --- a/HandyControl/HandyControl.csproj +++ b/HandyControl/HandyControl.csproj @@ -38,6 +38,7 @@ + @@ -250,6 +251,14 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -262,6 +271,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -282,6 +295,10 @@ MSBuild:Compile Designer + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -294,6 +311,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -314,6 +335,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -342,6 +367,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -374,6 +403,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/HandyControl/Properties/AssemblyInfo.cs b/HandyControl/Properties/AssemblyInfo.cs index 6b71d2a0..21296cda 100644 --- a/HandyControl/Properties/AssemblyInfo.cs +++ b/HandyControl/Properties/AssemblyInfo.cs @@ -10,5 +10,5 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] -[assembly: AssemblyVersion("1.3.0.0")] -[assembly: AssemblyFileVersion("1.3.0.0")] +[assembly: AssemblyVersion("1.3.1.0")] +[assembly: AssemblyFileVersion("1.3.1.0")] diff --git a/HandyControl/Themes/Basic/Converters.xaml b/HandyControl/Themes/Basic/Converters.xaml index 4cf30a0a..a4ae0c09 100644 --- a/HandyControl/Themes/Basic/Converters.xaml +++ b/HandyControl/Themes/Basic/Converters.xaml @@ -11,7 +11,7 @@ - - + + \ No newline at end of file diff --git a/HandyControl/Themes/Styles/Base/ButtonBaseStyle.xaml b/HandyControl/Themes/Styles/Base/ButtonBaseStyle.xaml index 3a6e62c8..e78fcba5 100644 --- a/HandyControl/Themes/Styles/Base/ButtonBaseStyle.xaml +++ b/HandyControl/Themes/Styles/Base/ButtonBaseStyle.xaml @@ -14,7 +14,7 @@ - + @@ -48,7 +48,7 @@ - + diff --git a/HandyControl/Themes/Styles/Base/ComboBoxBaseStyle.xaml b/HandyControl/Themes/Styles/Base/ComboBoxBaseStyle.xaml new file mode 100644 index 00000000..fe644631 --- /dev/null +++ b/HandyControl/Themes/Styles/Base/ComboBoxBaseStyle.xaml @@ -0,0 +1,538 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/HandyControl/Themes/Styles/Base/DatePickerBaseStyle.xaml b/HandyControl/Themes/Styles/Base/DatePickerBaseStyle.xaml new file mode 100644 index 00000000..81d8072e --- /dev/null +++ b/HandyControl/Themes/Styles/Base/DatePickerBaseStyle.xaml @@ -0,0 +1,85 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/HandyControl/Themes/Styles/Base/PasswordBoxBaseStyle.xaml b/HandyControl/Themes/Styles/Base/PasswordBoxBaseStyle.xaml new file mode 100644 index 00000000..79198f07 --- /dev/null +++ b/HandyControl/Themes/Styles/Base/PasswordBoxBaseStyle.xaml @@ -0,0 +1,44 @@ + + + + + \ No newline at end of file diff --git a/HandyControl/Themes/Styles/Base/ScrollViewerBaseStyle.xaml b/HandyControl/Themes/Styles/Base/ScrollViewerBaseStyle.xaml index 198893b8..6134dd61 100644 --- a/HandyControl/Themes/Styles/Base/ScrollViewerBaseStyle.xaml +++ b/HandyControl/Themes/Styles/Base/ScrollViewerBaseStyle.xaml @@ -35,6 +35,7 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -157,6 +200,12 @@ + + + + + + \ No newline at end of file diff --git a/HandyControl/Themes/Styles/Base/TimePickerBaseStyle.xaml b/HandyControl/Themes/Styles/Base/TimePickerBaseStyle.xaml new file mode 100644 index 00000000..4d25ca7f --- /dev/null +++ b/HandyControl/Themes/Styles/Base/TimePickerBaseStyle.xaml @@ -0,0 +1,65 @@ + + + + + + + + + + \ No newline at end of file diff --git a/HandyControl/Themes/Styles/Base/ToggleButtonBaseStyle.xaml b/HandyControl/Themes/Styles/Base/ToggleButtonBaseStyle.xaml index 41d2f9f1..a421b331 100644 --- a/HandyControl/Themes/Styles/Base/ToggleButtonBaseStyle.xaml +++ b/HandyControl/Themes/Styles/Base/ToggleButtonBaseStyle.xaml @@ -54,7 +54,7 @@ - + @@ -189,7 +189,7 @@ - + @@ -236,7 +236,7 @@ - + diff --git a/HandyControl/Themes/Styles/Button.xaml b/HandyControl/Themes/Styles/Button.xaml index 618afb97..a0a3b426 100644 --- a/HandyControl/Themes/Styles/Button.xaml +++ b/HandyControl/Themes/Styles/Button.xaml @@ -84,7 +84,7 @@ - + diff --git a/HandyControl/Themes/Styles/Clock.xaml b/HandyControl/Themes/Styles/Clock.xaml index d1afc42f..2503b846 100644 --- a/HandyControl/Themes/Styles/Clock.xaml +++ b/HandyControl/Themes/Styles/Clock.xaml @@ -59,6 +59,7 @@ - - - + \ No newline at end of file diff --git a/HandyControl/Themes/Styles/Pagination.xaml b/HandyControl/Themes/Styles/Pagination.xaml index 97ef3fb4..bac957ec 100644 --- a/HandyControl/Themes/Styles/Pagination.xaml +++ b/HandyControl/Themes/Styles/Pagination.xaml @@ -43,7 +43,7 @@ - + diff --git a/HandyControl/Themes/Styles/PasswordBox.xaml b/HandyControl/Themes/Styles/PasswordBox.xaml new file mode 100644 index 00000000..b0406953 --- /dev/null +++ b/HandyControl/Themes/Styles/PasswordBox.xaml @@ -0,0 +1,88 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/HandyControl/Themes/Styles/ScrollViewer.xaml b/HandyControl/Themes/Styles/ScrollViewer.xaml index 2a577eef..b36f36b1 100644 --- a/HandyControl/Themes/Styles/ScrollViewer.xaml +++ b/HandyControl/Themes/Styles/ScrollViewer.xaml @@ -6,7 +6,9 @@ - + + + \ No newline at end of file diff --git a/HandyControl/Themes/Styles/Style.xaml b/HandyControl/Themes/Styles/Style.xaml index 4813232c..46349e53 100644 --- a/HandyControl/Themes/Styles/Style.xaml +++ b/HandyControl/Themes/Styles/Style.xaml @@ -5,29 +5,22 @@ - - - - - - - - - - + + + diff --git a/HandyControl/Themes/Styles/TextBox.xaml b/HandyControl/Themes/Styles/TextBox.xaml index 257b5c73..12a6cfa2 100644 --- a/HandyControl/Themes/Styles/TextBox.xaml +++ b/HandyControl/Themes/Styles/TextBox.xaml @@ -1,30 +1,83 @@  + xmlns:controls="clr-namespace:HandyControl.Controls" + xmlns:system="clr-namespace:System;assembly=mscorlib"> + + - - \ No newline at end of file diff --git a/HandyControl/Themes/Styles/ToggleButton.xaml b/HandyControl/Themes/Styles/ToggleButton.xaml index a54b0c56..0be61753 100644 --- a/HandyControl/Themes/Styles/ToggleButton.xaml +++ b/HandyControl/Themes/Styles/ToggleButton.xaml @@ -139,7 +139,7 @@ - + diff --git a/HandyControl/Themes/Styles/ToolTip.xaml b/HandyControl/Themes/Styles/ToolTip.xaml new file mode 100644 index 00000000..83bb6b33 --- /dev/null +++ b/HandyControl/Themes/Styles/ToolTip.xaml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/HandyControlDemo/Data/MessageToken.cs b/HandyControlDemo/Data/MessageToken.cs index 0d3b673a..fccdd53b 100644 --- a/HandyControlDemo/Data/MessageToken.cs +++ b/HandyControlDemo/Data/MessageToken.cs @@ -26,6 +26,8 @@ public static readonly string TimePickerDemoCtl = nameof(TimePickerDemoCtl); + public static readonly string CirclePanelDemoCtl = nameof(CirclePanelDemoCtl); + public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl); public static readonly string ToggleButtonDemoCtl = nameof(ToggleButtonDemoCtl); @@ -40,6 +42,14 @@ public static readonly string DatePickerDemoCtl = nameof(DatePickerDemoCtl); + public static readonly string TextBoxDemoCtl = nameof(TextBoxDemoCtl); + + public static readonly string TextBlockDemoCtl = nameof(TextBlockDemoCtl); + + public static readonly string ComboBoxDemoCtl = nameof(ComboBoxDemoCtl); + + public static readonly string PasswordBoxDemoCtl = nameof(PasswordBoxDemoCtl); + public static readonly string LoadShowContent = nameof(LoadShowContent); } } \ No newline at end of file diff --git a/HandyControlDemo/Data/MessageToken.tt b/HandyControlDemo/Data/MessageToken.tt index 68956cc5..8e549b16 100644 --- a/HandyControlDemo/Data/MessageToken.tt +++ b/HandyControlDemo/Data/MessageToken.tt @@ -15,7 +15,8 @@ var controlList = new List "AnimationPathDemoCtl", "StepBarDemoCtl", "ClockDemoCtl", - "TimePickerDemoCtl" + "TimePickerDemoCtl", + "CirclePanelDemoCtl" }; var styleList = new List { @@ -25,7 +26,11 @@ var styleList = new List "ProgressBarDemoCtl", "TabControlDemoCtl", "CalendarDemoCtl", - "DatePickerDemoCtl" + "DatePickerDemoCtl", + "TextBoxDemoCtl", + "TextBlockDemoCtl", + "ComboBoxDemoCtl", + "PasswordBoxDemoCtl" }; #> namespace HandyControlDemo.Data diff --git a/HandyControlDemo/HandyControlDemo.csproj b/HandyControlDemo/HandyControlDemo.csproj index bf29c945..1592ca85 100644 --- a/HandyControlDemo/HandyControlDemo.csproj +++ b/HandyControlDemo/HandyControlDemo.csproj @@ -78,12 +78,16 @@ Lang.en.resx + AnimationPathDemoCtl.xaml CarouselDemoCtl.xaml + + CirclePanelDemoCtl.xaml + ClockDemoCtl.xaml @@ -117,6 +121,9 @@ CalendarDemoCtl.xaml + + ComboBoxDemoCtl.xaml + DatePickerDemoCtl.xaml @@ -135,15 +142,25 @@ TimeBarDemoCtl.xaml + + PasswordBoxDemoCtl.xaml + ProgressBarDemoCtl.xaml TabControlDemoCtl.xaml + + TextBlockDemoCtl.xaml + + + TextBoxDemoCtl.xaml + ToggleButtonDemoCtl.xaml + @@ -168,10 +185,18 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -192,6 +217,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -236,6 +265,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -260,6 +293,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -268,6 +305,14 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/HandyControlDemo/Properties/AssemblyInfo.cs b/HandyControlDemo/Properties/AssemblyInfo.cs index c4043395..6bb913ac 100644 --- a/HandyControlDemo/Properties/AssemblyInfo.cs +++ b/HandyControlDemo/Properties/AssemblyInfo.cs @@ -12,5 +12,5 @@ using System.Windows; [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] -[assembly: AssemblyVersion("1.3.0.0")] -[assembly: AssemblyFileVersion("1.3.0.0")] +[assembly: AssemblyVersion("1.3.1.0")] +[assembly: AssemblyFileVersion("1.3.1.0")] diff --git a/HandyControlDemo/Properties/Langs/Lang.Designer.cs b/HandyControlDemo/Properties/Langs/Lang.Designer.cs index ed5b1271..91f27645 100644 --- a/HandyControlDemo/Properties/Langs/Lang.Designer.cs +++ b/HandyControlDemo/Properties/Langs/Lang.Designer.cs @@ -123,6 +123,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 圆形布局 的本地化字符串。 + /// + public static string CirclePanel { + get { + return ResourceManager.GetString("CirclePanel", resourceCulture); + } + } + /// /// 查找类似 时钟 的本地化字符串。 /// @@ -141,6 +150,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 组合框 的本地化字符串。 + /// + public static string ComboBox { + get { + return ResourceManager.GetString("ComboBox", resourceCulture); + } + } + /// /// 查找类似 对比滑块 的本地化字符串。 /// @@ -159,6 +177,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 这是内容 的本地化字符串。 + /// + public static string ContentDemoStr { + get { + return ResourceManager.GetString("ContentDemoStr", resourceCulture); + } + } + /// /// 查找类似 控件 的本地化字符串。 /// @@ -321,6 +348,24 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 密码框 的本地化字符串。 + /// + public static string PasswordBox { + get { + return ResourceManager.GetString("PasswordBox", resourceCulture); + } + } + + /// + /// 查找类似 请输入内容 的本地化字符串。 + /// + public static string PlsEnterContent { + get { + return ResourceManager.GetString("PlsEnterContent", resourceCulture); + } + } + /// /// 查找类似 上一步 的本地化字符串。 /// @@ -375,6 +420,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 子标题 的本地化字符串。 + /// + public static string SubTitle { + get { + return ResourceManager.GetString("SubTitle", resourceCulture); + } + } + /// /// 查找类似 成功 的本地化字符串。 /// @@ -393,6 +447,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 正文 的本地化字符串。 + /// + public static string Text { + get { + return ResourceManager.GetString("Text", resourceCulture); + } + } + /// /// 查找类似 文本块 的本地化字符串。 /// @@ -402,6 +465,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 文本框 的本地化字符串。 + /// + public static string TextBox { + get { + return ResourceManager.GetString("TextBox", resourceCulture); + } + } + /// /// 查找类似 时间条 的本地化字符串。 /// @@ -429,6 +501,33 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 这是标题 的本地化字符串。 + /// + public static string TitleDemoStr1 { + get { + return ResourceManager.GetString("TitleDemoStr1", resourceCulture); + } + } + + /// + /// 查找类似 此项必填 的本地化字符串。 + /// + public static string TitleDemoStr2 { + get { + return ResourceManager.GetString("TitleDemoStr2", resourceCulture); + } + } + + /// + /// 查找类似 标题在左侧 的本地化字符串。 + /// + public static string TitleDemoStr3 { + get { + return ResourceManager.GetString("TitleDemoStr3", resourceCulture); + } + } + /// /// 查找类似 切换按钮 的本地化字符串。 /// diff --git a/HandyControlDemo/Properties/Langs/Lang.en.resx b/HandyControlDemo/Properties/Langs/Lang.en.resx index 5573ee87..741cf0ce 100644 --- a/HandyControlDemo/Properties/Langs/Lang.en.resx +++ b/HandyControlDemo/Properties/Langs/Lang.en.resx @@ -249,4 +249,37 @@ TimePicker + + TextBox + + + This is the content + + + This is the title + + + This item must be filled in + + + Please enter content + + + The title is on the left + + + Text + + + Subtitle + + + PasswordBox + + + CirclePanel + + + ComboBox + \ No newline at end of file diff --git a/HandyControlDemo/Properties/Langs/Lang.resx b/HandyControlDemo/Properties/Langs/Lang.resx index 29574bbd..b5a6042d 100644 --- a/HandyControlDemo/Properties/Langs/Lang.resx +++ b/HandyControlDemo/Properties/Langs/Lang.resx @@ -229,4 +229,37 @@ 时间选择器 + + 文本框 + + + 这是内容 + + + 这是标题 + + + 此项必填 + + + 请输入内容 + + + 标题在左侧 + + + 正文 + + + 子标题 + + + 密码框 + + + 圆形布局 + + + 组合框 + \ No newline at end of file diff --git a/HandyControlDemo/Resources/Themes/Basic/Converters.xaml b/HandyControlDemo/Resources/Themes/Basic/Converters.xaml new file mode 100644 index 00000000..f979cb7f --- /dev/null +++ b/HandyControlDemo/Resources/Themes/Basic/Converters.xaml @@ -0,0 +1,7 @@ + + + + + \ No newline at end of file diff --git a/HandyControlDemo/Resources/Themes/Basic/Geometries.xaml b/HandyControlDemo/Resources/Themes/Basic/Geometries.xaml index 30fb4ba4..265bebc3 100644 --- a/HandyControlDemo/Resources/Themes/Basic/Geometries.xaml +++ b/HandyControlDemo/Resources/Themes/Basic/Geometries.xaml @@ -3,5 +3,7 @@ M512 0h1216a512 512 0 1 1 0 1024H512A512 512 0 1 1 512 0zM420.16 311.04V768h74.88V433.92h2.56l228.48 334.08h72.96V311.04h-75.52v329.6h-2.56l-225.92-329.6h-74.88z m468.48 0V768h340.48v-64h-265.6V565.76h239.36v-64h-239.36V375.04h254.72v-64h-329.6z m369.28 0l131.2 456.96h80l89.6-343.68h2.56l88.96 343.68h79.36l131.84-456.96h-84.48l-85.76 347.52h-2.56l-90.24-347.52h-77.44l-90.24 347.52h-2.56l-85.76-347.52h-84.48z M40.493382,19.001303 C36.637875,19.06448 33.938568,21.421986 33.948524,25.271919 L34.068279,71.56765 34.066906,71.598007 34.068745,71.747833 34.18895,118.21758 C34.202225,123.35083 39.026951,129.19344 44.965271,131.2674 50.903587,133.34137 55.706783,130.86133 55.693504,125.72808 L55.589508,85.524513 93.866371,85.524513 93.950943,118.21758 C93.964218,123.35083 98.788948,129.19344 104.72726,131.2674 110.66558,133.34137 115.46878,130.86133 115.4555,125.72808 L115.33575,79.432381 115.33712,79.401993 115.33528,79.252007 115.21507,32.782413 C115.2018,27.64917 110.37708,21.806566 104.43876,19.732603 98.500435,17.658638 93.697243,20.138674 93.710518,25.271919 L93.814514,65.475487 55.537647,65.475487 55.453079,32.782413 C55.439804,27.64917 50.615082,21.806566 44.676762,19.732603 43.192181,19.214111 41.778549,18.980244 40.493382,19.001303 z M9.999999,0 L140,0 C145.52284,0 150,4.4771523 150,9.999999 L150,140 C150,145.52284 145.52284,150 140,150 L9.999999,150 C4.4771523,150 0,145.52284 0,140 L0,9.999999 C0,4.4771523 4.4771523,0 9.999999,0 z + M28.677037,-2.2499313E-22 C38.75065,24.740243 38.50705,52.437974 27.999852,77.000001 L-1.7053028E-13,65.206651 C7.3550318,48.013234 7.5255431,28.624822 0.4740567,11.306663 z + M267.287478 892.162257c0 45.149912 59.597884 71.336861 93.008818 37.925926L740.458554 549.925926c21.671958-21.671958 21.671958-54.179894 0-75.851852L360.296296 93.911817c-33.410935-33.410935-93.008818-5.417989-93.008818 38.828924v759.421516z m0 0 \ No newline at end of file diff --git a/HandyControlDemo/Resources/Themes/Styles/Button.xaml b/HandyControlDemo/Resources/Themes/Styles/Button.xaml new file mode 100644 index 00000000..076d5b4c --- /dev/null +++ b/HandyControlDemo/Resources/Themes/Styles/Button.xaml @@ -0,0 +1,35 @@ + + + + + + + + + \ No newline at end of file diff --git a/HandyControlDemo/Resources/Themes/Styles/Style.xaml b/HandyControlDemo/Resources/Themes/Styles/Style.xaml index c187fff7..6d965fde 100644 --- a/HandyControlDemo/Resources/Themes/Styles/Style.xaml +++ b/HandyControlDemo/Resources/Themes/Styles/Style.xaml @@ -3,8 +3,10 @@ + + \ No newline at end of file diff --git a/HandyControlDemo/Tools/Converter/StringRepeatConverter.cs b/HandyControlDemo/Tools/Converter/StringRepeatConverter.cs new file mode 100644 index 00000000..ab297231 --- /dev/null +++ b/HandyControlDemo/Tools/Converter/StringRepeatConverter.cs @@ -0,0 +1,45 @@ +using System; +using System.Globalization; +using System.Text; +using System.Windows.Data; + +namespace HandyControlDemo.Tools.Converter +{ + public class StringRepeatConverter : IValueConverter + { + public object Convert(object value, Type targetType, object parameter, CultureInfo culture) + { + if (value is string strValue) + { + var builder = new StringBuilder(); + int num; + if (parameter is string numStr) + { + if (!int.TryParse(numStr, out num)) + { + return strValue; + } + } + else if(parameter is int intValue) + { + num = intValue; + } + else + { + return strValue; + } + for (var i = 0; i < num; i++) + { + builder.Append(strValue); + } + return builder.ToString(); + } + return string.Empty; + } + + public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) + { + throw new NotImplementedException(); + } + } +} \ No newline at end of file diff --git a/HandyControlDemo/UserControl/Controls/CirclePanelDemoCtl.xaml b/HandyControlDemo/UserControl/Controls/CirclePanelDemoCtl.xaml new file mode 100644 index 00000000..4b9b84c5 --- /dev/null +++ b/HandyControlDemo/UserControl/Controls/CirclePanelDemoCtl.xaml @@ -0,0 +1,18 @@ + + + +