From e1c3c5e7781b21459a711be1331ed7eb446f5684 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Tue, 23 Apr 2019 23:50:55 +0800 Subject: [PATCH 1/2] add RepeatButton demo --- .../HandyControlDemo_Core30.csproj | 18 ++++ .../HandyControlDemo_Net_40.csproj | 14 +++ .../HandyControlDemo_Net_GE45.csproj | 18 ++++ .../Data/MessageToken.cs | 2 + .../Data/MessageToken.tt | 1 + .../HandyControlDemo_Shared.projitems | 15 ++- .../Img/LeftMainContent/RepeatButton_16x.png | Bin 0 -> 498 bytes .../UserControl/Main/LeftMainContent.xaml | 5 + .../Styles/RepeatButtonDemoCtl.xaml | 88 ++++++++++++++++++ .../Styles/RepeatButtonDemoCtl.xaml.cs | 10 ++ .../Themes/Styles/Style.xaml | 1 + 11 files changed, 164 insertions(+), 8 deletions(-) create mode 100644 src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/RepeatButton_16x.png create mode 100644 src/Shared/HandyControlDemo_Shared/UserControl/Styles/RepeatButtonDemoCtl.xaml create mode 100644 src/Shared/HandyControlDemo_Shared/UserControl/Styles/RepeatButtonDemoCtl.xaml.cs diff --git a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj index 918da006..ad06e972 100644 --- a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj +++ b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj @@ -20,6 +20,12 @@ + + Data\MessageToken.cs + True + True + MessageToken.tt + Properties\Langs\Lang.Designer.cs True @@ -323,5 +329,17 @@ Lang.Designer.cs + + + Data\MessageToken.tt + TextTemplatingFileGenerator + MessageToken.cs + + + + + TextTemplatingFileGenerator + + \ No newline at end of file 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 341b4731..c36daf2e 100644 --- a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj +++ b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj @@ -63,6 +63,12 @@ + + Data\MessageToken.cs + True + True + MessageToken.tt + NoUserContent.xaml @@ -375,6 +381,14 @@ Lang.Designer.cs + + + + Data\MessageToken.tt + TextTemplatingFileGenerator + MessageToken.cs + + \ No newline at end of file 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 1b1101c3..4d5aaea8 100644 --- a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj +++ b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj @@ -90,6 +90,12 @@ + + Data\MessageToken.cs + True + True + MessageToken.tt + Properties\Langs\Lang.Designer.cs True @@ -394,6 +400,18 @@ Lang.Designer.cs + + + Resources\Img\LeftMainContent\RepeatButton_16x.png + + + + + Data\MessageToken.tt + TextTemplatingFileGenerator + MessageToken.cs + + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs index 588216c5..f18997b6 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs +++ b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.cs @@ -94,6 +94,8 @@ public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl); + public static readonly string RepeatButtonDemoCtl = nameof(RepeatButtonDemoCtl); + public static readonly string ToggleButtonDemoCtl = nameof(ToggleButtonDemoCtl); public static readonly string ExpanderDemoCtl = nameof(ExpanderDemoCtl); diff --git a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt index dee74b06..f2b34cf8 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt +++ b/src/Shared/HandyControlDemo_Shared/Data/MessageToken.tt @@ -53,6 +53,7 @@ var controlList = new List var styleList = new List { "ButtonDemoCtl", + "RepeatButtonDemoCtl", "ToggleButtonDemoCtl", "ExpanderDemoCtl", "NativeProgressBarDemoCtl", diff --git a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems index c966271f..e75eb61a 100644 --- a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems +++ b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems @@ -16,11 +16,6 @@ - - MessageToken.tt - True - True - @@ -253,6 +248,9 @@ RadioButtonDemoCtl.xaml + + RepeatButtonDemoCtl.xaml + RichTextBoxDemoCtl.xaml @@ -307,9 +305,6 @@ NoNonClientAreaDragableWindow.xaml - - - Designer @@ -643,6 +638,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/RepeatButton_16x.png b/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/RepeatButton_16x.png new file mode 100644 index 0000000000000000000000000000000000000000..630f666459787aa751cfee5a804c162615674685 GIT binary patch literal 498 zcmV;p2qEY{;&BTa zhOrA%gXWGsMTswI-Mq;&z{xocG(T z=7bGp9Q37MC=|HxlbKq@)-~pto|7IzTu~GQTj0V&O#gCf(B^w~5);2?+E%esg9e`ETe(~&iwRp^1Ahf@v-LNc oAERnM&meSW-g6C;KgdOX0I_l0g)nhPX#fBK07*qoM6N<$f@ZDT%>V!Z literal 0 HcmV?d00001 diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml index 1f1fb986..a6d448a2 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Main/LeftMainContent.xaml @@ -44,6 +44,11 @@ + + + + + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/RepeatButtonDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/RepeatButtonDemoCtl.xaml new file mode 100644 index 00000000..915ca790 --- /dev/null +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/RepeatButtonDemoCtl.xaml @@ -0,0 +1,88 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/RepeatButtonDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/RepeatButtonDemoCtl.xaml.cs new file mode 100644 index 00000000..49820298 --- /dev/null +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/RepeatButtonDemoCtl.xaml.cs @@ -0,0 +1,10 @@ +namespace HandyControlDemo.UserControl +{ + public partial class RepeatButtonDemoCtl + { + public RepeatButtonDemoCtl() + { + InitializeComponent(); + } + } +} diff --git a/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml b/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml index be50b99a..6f0df42e 100644 --- a/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml +++ b/src/Shared/HandyControl_Shared/Themes/Styles/Style.xaml @@ -5,6 +5,7 @@ + From c8d72807657ffc93cc7ba3b0e5a9d0ea63996177 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Wed, 24 Apr 2019 00:14:52 +0800 Subject: [PATCH 2/2] improved demo --- .../HandyControlDemo_Core30.csproj | 3 ++ .../HandyControlDemo_Net_40.csproj | 3 ++ .../Properties/Langs/Lang.Designer.cs | 6 ++-- .../Properties/Langs/Lang.en.resx | 4 +-- .../Properties/Langs/Lang.resx | 4 +-- .../UserControl/Styles/ButtonDemoCtl.xaml | 4 +-- .../Styles/RepeatButtonDemoCtl.xaml | 28 +++++++++---------- 7 files changed, 29 insertions(+), 23 deletions(-) diff --git a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj index ad06e972..62a7d384 100644 --- a/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj +++ b/src/Core_30/HandyControlDemo_Core_30/HandyControlDemo_Core30.csproj @@ -249,6 +249,9 @@ Resources\Img\LeftMainContent\RadioButton_16x.png + + Resources\Img\LeftMainContent\RepeatButton_16x.png + Resources\Img\LeftMainContent\RichTextBox_16x.png 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 c36daf2e..bd927660 100644 --- a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj +++ b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj @@ -388,6 +388,9 @@ TextTemplatingFileGenerator MessageToken.cs + + Resources\Img\LeftMainContent\RepeatButton_16x.png + diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs index 707c4c04..a7fd0216 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs @@ -160,11 +160,11 @@ namespace HandyControlDemo.Properties.Langs { } /// - /// 查找类似 透明按钮 的本地化字符串。 + /// 查找类似 自定义按钮 的本地化字符串。 /// - public static string ButtonOpacity { + public static string ButtonCustom { get { - return ResourceManager.GetString("ButtonOpacity", resourceCulture); + return ResourceManager.GetString("ButtonCustom", resourceCulture); } } diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx index 9d48cc46..2a8b794f 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx @@ -210,8 +210,8 @@ Danger - - Opacity button + + Custom button Title diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx index 6a8f3b34..cf61aec3 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx @@ -210,8 +210,8 @@ 危险 - - 透明按钮 + + 自定义按钮 标题 diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/ButtonDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/ButtonDemoCtl.xaml index 9de81c9e..2bfb5148 100644 --- a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/ButtonDemoCtl.xaml +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/ButtonDemoCtl.xaml @@ -72,8 +72,8 @@ -