From fa863c5bcba326f8e1d636b942fbbbac6ab44d02 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Thu, 24 Oct 2019 21:58:34 +0800 Subject: [PATCH 1/3] init branch --- .../HandyControlDemo_Core30.csproj | 10 +++-- .../HandyControl_Core_30.csproj | 5 ++- .../HandyControlDemo_Net_40.csproj | 3 ++ .../HandyControlDemo_Net_GE45.csproj | 3 ++ .../Data/MessageToken.cs | 2 + .../Data/MessageToken.tt | 3 +- .../HandyControlDemo_Shared.projitems | 7 ++++ .../HandyControlDemo_Shared/MainWindow.xaml | 26 +++++++------ .../Properties/AssemblyInfo.cs | 2 +- .../Properties/Langs/Lang.Designer.cs | 9 +++++ .../Properties/Langs/Lang.en.resx | 3 ++ .../Properties/Langs/Lang.fa.resx | 3 ++ .../Properties/Langs/Lang.fr.resx | 3 ++ .../Properties/Langs/Lang.resx | 3 ++ .../LeftMainContent/DottedSplitter_16x.png | Bin 0 -> 125 bytes .../UserControl/Controls/DividerDemoCtl.xaml | 8 ++++ .../Controls/DividerDemoCtl.xaml.cs | 10 +++++ .../UserControl/Main/LeftMainContent.xaml | 7 +++- .../Controls/Other/Divider.cs | 36 ++++++++++++++++++ .../HandyControl_Shared.projitems | 9 +++++ .../Properties/AssemblyInfo.cs | 2 +- .../Themes/Styles/Base/DividerBaseStyle.xaml | 9 +++++ .../Themes/Styles/Divider.xaml | 10 +++++ .../Themes/Styles/Style.xaml | 1 + 24 files changed, 153 insertions(+), 21 deletions(-) create mode 100644 src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/DottedSplitter_16x.png create mode 100644 src/Shared/HandyControlDemo_Shared/UserControl/Controls/DividerDemoCtl.xaml create mode 100644 src/Shared/HandyControlDemo_Shared/UserControl/Controls/DividerDemoCtl.xaml.cs create mode 100644 src/Shared/HandyControl_Shared/Controls/Other/Divider.cs create mode 100644 src/Shared/HandyControl_Shared/Themes/Styles/Base/DividerBaseStyle.xaml create mode 100644 src/Shared/HandyControl_Shared/Themes/Styles/Divider.xaml diff --git a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj index d785a5c1..1b7528d8 100644 --- a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj +++ b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj @@ -5,13 +5,14 @@ true HandyControlDemo HandyControlDemo - 2.2.0 + 2.3.0 ..\..\Shared\HandyControlDemo_Shared\Resources\Img\icon.ico Debug;Release Copyright © HandyOrg 2018-2019 - 2.2.0.0 - 2.2.0.0 + 2.3.0.0 + 2.3.0.0 8.0 + HandyOrg TRACE;Core @@ -426,6 +427,9 @@ Resources\Img\LeftMainContent\DataGenerator_16x.png + + Resources\Img\LeftMainContent\DottedSplitter_16x.png + diff --git a/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj b/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj index cbf01071..19e745b0 100644 --- a/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj +++ b/src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj @@ -4,14 +4,15 @@ true HandyControl HandyControl - 2.2.0 - 2.2.0.0 + 2.3.0 + 2.3.0.0 false false Copyright © HandyOrg 2018-2019 Contains some commonly used simple WPF controls Debug;Release 8.0 + HandyOrg TRACE;Core diff --git a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj index af34f24b..6ea01470 100644 --- a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj +++ b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj @@ -427,6 +427,9 @@ TextTemplatingFileGenerator MessageToken.cs + + Resources\Img\LeftMainContent\DottedSplitter_16x.png + Resources\Img\qq_group_1.jpg diff --git a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj index c58b88a3..d7566d1b 100644 --- a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj +++ b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj @@ -496,6 +496,9 @@ TextTemplatingFileGenerator MessageToken.cs + + Resources\Img\LeftMainContent\DottedSplitter_16x.png + Resources\Img\qq_group_1.jpg diff --git a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs index 717a71ac..c59c99a0 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs +++ b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs @@ -120,6 +120,8 @@ public static readonly string SplitButtonDemoCtl = nameof(SplitButtonDemoCtl); + public static readonly string DividerDemoCtl = nameof(DividerDemoCtl); + /*-------------------- Tools --------------------*/ public static readonly string HatchBrushGeneratorDemoCtl = nameof(HatchBrushGeneratorDemoCtl); diff --git a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt index 91d84fbb..201cc75c 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt +++ b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt @@ -61,7 +61,8 @@ var controlList = new List "SpriteDemoCtl", "NotificationDemoCtl", "FloatingBlockDemoCtl", - "SplitButtonDemoCtl" + "SplitButtonDemoCtl", + "DividerDemoCtl" }; var styleList = new List { diff --git a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems index b13bd738..53ef32fc 100644 --- a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems +++ b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems @@ -55,6 +55,9 @@ CardDemoCtl.xaml + + DividerDemoCtl.xaml + FloatingBlockDemoCtl.xaml @@ -460,6 +463,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/src/Shared/HandyControlDemo_Shared/MainWindow.xaml b/src/Shared/HandyControlDemo_Shared/MainWindow.xaml index 9ff31060..867219d7 100644 --- a/src/Shared/HandyControlDemo_Shared/MainWindow.xaml +++ b/src/Shared/HandyControlDemo_Shared/MainWindow.xaml @@ -26,16 +26,18 @@ - - - - - - - - - - - - + + + + + + + + + + + + + + diff --git a/src/Shared/HandyControlDemo_Shared/Properties/AssemblyInfo.cs b/src/Shared/HandyControlDemo_Shared/Properties/AssemblyInfo.cs index da33491c..e87a0781 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/AssemblyInfo.cs +++ b/src/Shared/HandyControlDemo_Shared/Properties/AssemblyInfo.cs @@ -13,5 +13,5 @@ using System.Windows; [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] [assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)] -[assembly: AssemblyVersion("2.2.0")] +[assembly: AssemblyVersion("2.3.0")] #endif \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs index b26bcdf7..e2cf3fe6 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs @@ -492,6 +492,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 分割线 的本地化字符串。 + /// + public static string Divider { + get { + return ResourceManager.GetString("Divider", resourceCulture); + } + } + /// /// 查找类似 在这里拖拽 的本地化字符串。 /// diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx index efa53531..f555d91f 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx @@ -675,4 +675,7 @@ Morphing Animation + + Divider + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx index 3ee98c1b..170b2ced 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx @@ -675,4 +675,7 @@ Morphing Animation + + Divider + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx index 6c7214be..f7c5365c 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx @@ -675,4 +675,7 @@ Morphing Animation + + Divider + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx index 3950a730..2d26de95 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx @@ -675,4 +675,7 @@ 变形动画 + + 分割线 + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/DottedSplitter_16x.png b/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/DottedSplitter_16x.png new file mode 100644 index 0000000000000000000000000000000000000000..14b2af988d23ec476fc2572fe74398a237dd3dfa GIT binary patch literal 125 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5he4R}c>anMprF2| zi(^Pd+}r+*oD2*chxe@gfB$mm!KQ V*Z1OP3xHY~JYD@<);T3K0RU5XDeeFO literal 0 HcmV?d00001 diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/DividerDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/DividerDemoCtl.xaml new file mode 100644 index 00000000..ac5613e2 --- /dev/null +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/DividerDemoCtl.xaml @@ -0,0 +1,8 @@ + + + + + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/DividerDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/DividerDemoCtl.xaml.cs new file mode 100644 index 00000000..7cd8f16f --- /dev/null +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/DividerDemoCtl.xaml.cs @@ -0,0 +1,10 @@ +namespace HandyControlDemo.UserControl +{ + public partial class DividerDemoCtl + { + public DividerDemoCtl() + { + InitializeComponent(); + } + } +} diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml index a3bd5714..2081856c 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml @@ -345,6 +345,11 @@ + + + + + @@ -455,7 +460,7 @@ - + diff --git a/src/Shared/HandyControl_Shared/Controls/Other/Divider.cs b/src/Shared/HandyControl_Shared/Controls/Other/Divider.cs new file mode 100644 index 00000000..87ab5736 --- /dev/null +++ b/src/Shared/HandyControl_Shared/Controls/Other/Divider.cs @@ -0,0 +1,36 @@ +using System.Windows; +using System.Windows.Controls; +using HandyControl.Data; + +namespace HandyControl.Controls +{ + public class Divider : Control + { + public static readonly DependencyProperty ContentProperty = DependencyProperty.Register( + "Content", typeof(object), typeof(Divider), new PropertyMetadata(default(object))); + + public object Content + { + get => (object) GetValue(ContentProperty); + set => SetValue(ContentProperty, value); + } + + public static readonly DependencyProperty DashedProperty = DependencyProperty.Register( + "Dashed", typeof(bool), typeof(Divider), new PropertyMetadata(ValueBoxes.FalseBox)); + + public bool Dashed + { + get => (bool) GetValue(DashedProperty); + set => SetValue(DashedProperty, value); + } + + public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register( + "Orientation", typeof(Orientation), typeof(Divider), new PropertyMetadata(default(Orientation))); + + public Orientation Orientation + { + get => (Orientation) GetValue(OrientationProperty); + set => SetValue(OrientationProperty, value); + } + } +} \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems index 96093d43..0eb2b080 100644 --- a/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems +++ b/src/Shared/HandyControl_Shared/HandyControl_Shared.projitems @@ -24,6 +24,7 @@ + @@ -381,6 +382,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile @@ -425,6 +430,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/src/Shared/HandyControl_Shared/Properties/AssemblyInfo.cs b/src/Shared/HandyControl_Shared/Properties/AssemblyInfo.cs index 3e1281fb..15e58489 100644 --- a/src/Shared/HandyControl_Shared/Properties/AssemblyInfo.cs +++ b/src/Shared/HandyControl_Shared/Properties/AssemblyInfo.cs @@ -12,7 +12,7 @@ using System.Runtime.InteropServices; [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] [assembly: ComVisible(false)] -[assembly: AssemblyVersion("2.2.0")] +[assembly: AssemblyVersion("2.3.0")] #endif [assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Controls")] diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Base/DividerBaseStyle.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Base/DividerBaseStyle.xaml new file mode 100644 index 00000000..cb3723f0 --- /dev/null +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Base/DividerBaseStyle.xaml @@ -0,0 +1,9 @@ + + + + + \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Divider.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Divider.xaml new file mode 100644 index 00000000..aee6e531 --- /dev/null +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Divider.xaml @@ -0,0 +1,10 @@ + + + + + + + \ No newline at end of file diff --git a/src/Shared/HandyControl_Shared/Tools/Extension/ColLayout.cs b/src/Shared/HandyControl_Shared/Tools/Extension/ColLayout.cs index 91785099..4db36da3 100644 --- a/src/Shared/HandyControl_Shared/Tools/Extension/ColLayout.cs +++ b/src/Shared/HandyControl_Shared/Tools/Extension/ColLayout.cs @@ -13,6 +13,8 @@ namespace HandyControl.Tools.Extension { public static readonly int ColMaxCellCount = 24; + public static readonly int HalfColMaxCellCount = 12; + public static readonly int XsMaxWidth = 768; public static readonly int SmMaxWidth = 992; From 5abf20c1814c3191362dd90e24970077505fbadb Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Sun, 27 Oct 2019 22:46:38 +0800 Subject: [PATCH 3/3] add Divider --- README.md | 8 ++- .../UserControl/Controls/DividerDemoCtl.xaml | 44 +++++++++++--- .../HandyControl_Shared/Controls/Grid/Col.cs | 58 +++++++++++-------- .../HandyControl_Shared/Controls/Grid/Row.cs | 2 +- .../Themes/Styles/Base/DividerBaseStyle.xaml | 38 ++++++++++-- 5 files changed, 111 insertions(+), 39 deletions(-) diff --git a/README.md b/README.md index d15df9f0..8b23f787 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,10 @@ Step 4:enjoy coding ## Latest examples +### Divider + +![Divider](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Divider.png) + ### GeometryAnimation ![GeometryAnimation](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/GeometryAnimation.gif) @@ -81,6 +85,8 @@ Step 4:enjoy coding ![HoneycombPanel](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/HoneycombPanel.png) +## History publication + ### RunningBlock ![RunningBlock](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/RunningBlock.gif) @@ -91,8 +97,6 @@ Step 4:enjoy coding ![ImageBlock](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/ImageBlock.png) -## History publication - ### Magnifier ![Magnifier](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Magnifier.png) diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/DividerDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/DividerDemoCtl.xaml index 5c273b76..37fb29ea 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/DividerDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/DividerDemoCtl.xaml @@ -2,14 +2,42 @@ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:hc="https://handyorg.github.io/handycontrol" - Background="{DynamicResource RegionBrush}"> + Background="{DynamicResource RegionBrush}" + xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"> - - - - - - - + + + + + + + + + + + + +