From 2d9b6bb8ade187df3fd955cfea327c1357ed59c8 Mon Sep 17 00:00:00 2001 From: Mahdi Hosseini Date: Sat, 27 Jun 2020 15:29:14 +0430 Subject: [PATCH] add #400 --- .../HandyControlDemo_Net_40.csproj | 3 + .../HandyControlDemo_Net_GE45.csproj | 3 + .../Data/DemoInfo.json | 3 +- .../HandyControlDemo_Shared.projitems | 7 + .../Properties/Langs/Lang.Designer.cs | 10 +- .../Properties/Langs/Lang.en.resx | 3 + .../Properties/Langs/Lang.fa.resx | 3 + .../Properties/Langs/Lang.fr.resx | 3 + .../Properties/Langs/Lang.ko-KR.resx | 3 + .../Properties/Langs/Lang.pt-BR.resx | 143 ++++++++++-------- .../Properties/Langs/Lang.resx | 3 + .../Properties/Langs/Lang.ru.resx | 3 + .../Properties/Langs/Lang.tr.resx | 3 + .../Properties/Langs/LangProvider.cs | 6 +- .../Img/LeftMainContent/Geometry_16x.png | Bin 0 -> 470 bytes .../UserControl/Styles/GeometryDemoCtl.xaml | 11 ++ .../Styles/GeometryDemoCtl.xaml.cs | 34 +++++ 17 files changed, 178 insertions(+), 63 deletions(-) create mode 100644 src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/Geometry_16x.png create mode 100644 src/Shared/HandyControlDemo_Shared/UserControl/Styles/GeometryDemoCtl.xaml create mode 100644 src/Shared/HandyControlDemo_Shared/UserControl/Styles/GeometryDemoCtl.xaml.cs 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 c17c05bc..5ce52f21 100644 --- a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj +++ b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj @@ -412,6 +412,9 @@ Resources\Img\LeftMainContent\MainMenuControl_16x.png + + Resources\Img\LeftMainContent\Geometry_16x.png + Resources\fabric-icons.ttf 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 0a009190..b3896d28 100644 --- a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj +++ b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj @@ -411,6 +411,9 @@ Resources\Img\LeftMainContent\MainMenuControl_16x.png + + + Resources\Img\LeftMainContent\Geometry_16x.png Resources\fabric-icons.ttf diff --git a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json index 3f16bf4a..613c2d5a 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json +++ b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json @@ -32,7 +32,8 @@ [ "Border", "BorderDemoCtl", "BorderElement_16x", "" ], [ "Label", "LabelDemoCtl", "Label_16x", "" ], [ "Frame", "FrameDemoCtl", "frame_16xLG", "1" ], - [ "Window", "NativeWindowDemoCtl", "WindowsForm_16x", "1" ] + [ "Window", "NativeWindowDemoCtl", "WindowsForm_16x", "1" ], + [ "Geometry", "GeometryDemoCtl", "Geometry_16x", "1" ] ] }, { diff --git a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems index 0e17de7f..f32f6c4b 100644 --- a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems +++ b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems @@ -315,6 +315,9 @@ FrameDemoCtl.xaml + + + GeometryDemoCtl.xaml GroupBoxDemoCtl.xaml @@ -862,6 +865,10 @@ Designer MSBuild:Compile + + + Designer + MSBuild:Compile Designer diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs index 41e738c9..7f1a0b46 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs @@ -671,7 +671,15 @@ namespace HandyControlDemo.Properties.Langs { return ResourceManager.GetString("Frame", resourceCulture); } } - + + public static string Geometry + { + get + { + return ResourceManager.GetString("Geometry", resourceCulture); + } + } + /// /// 查找类似 Gif图片 的本地化字符串。 /// diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx index c732de69..090e5b57 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx @@ -756,4 +756,7 @@ ImageSelector + + Geometry + \ 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 55d816c1..2edb2676 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx @@ -756,4 +756,7 @@ ImageSelector + + Geometry + \ 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 c8d40632..57a16fd2 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx @@ -756,4 +756,7 @@ ImageSelector + + Geometry + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx index 145d2134..065145dc 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx @@ -756,4 +756,7 @@ ImageSelector + + Geometry + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.pt-BR.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.pt-BR.resx index 405807a2..ac7835dc 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.pt-BR.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.pt-BR.resx @@ -1,76 +1,96 @@  + mimetype: application/x-microsoft.net.object.bytearray.base64 + value : The object must be serialized into a byte array + : using a System.ComponentModel.TypeConverter + : and then encoded with base64 encoding. + --> + + + + + + + + + + + + + + + + + + - + + @@ -89,13 +109,13 @@ text/microsoft-resx - 1.3 + 2.0 - System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 Sobre @@ -736,4 +756,7 @@ Janela + + Geometry + \ 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 1035e112..fc08c26a 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx @@ -756,4 +756,7 @@ 图片选择器 + + Geometry + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ru.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ru.resx index c732de69..090e5b57 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ru.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ru.resx @@ -756,4 +756,7 @@ ImageSelector + + Geometry + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.tr.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.tr.resx index 988e40aa..b641cf03 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.tr.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.tr.resx @@ -756,4 +756,7 @@ ImageSelector + + Geometry + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/LangProvider.cs b/src/Shared/HandyControlDemo_Shared/Properties/Langs/LangProvider.cs index 9a7df866..41dba43c 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/LangProvider.cs +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/LangProvider.cs @@ -105,6 +105,7 @@ namespace HandyControlDemo.Properties.Langs OnPropertyChanged(nameof(FlowDocumentReader)); OnPropertyChanged(nameof(FlowDocumentScrollViewer)); OnPropertyChanged(nameof(Frame)); + OnPropertyChanged(nameof(Geometry)); OnPropertyChanged(nameof(GifImage)); OnPropertyChanged(nameof(GotoTop)); OnPropertyChanged(nameof(Gravatar)); @@ -592,10 +593,11 @@ namespace HandyControlDemo.Properties.Langs /// public string Frame => Lang.Frame; + public string Geometry => Lang.Geometry; /// /// 查找类似 Gif图片 的本地化字符串。 /// - public string GifImage => Lang.GifImage; + public string GifImage => Lang.GifImage; /// /// 查找类似 回到顶部 的本地化字符串。 @@ -1666,6 +1668,8 @@ namespace HandyControlDemo.Properties.Langs /// public static string Frame = nameof(Frame); + public static string Geometry = nameof(Geometry); + /// /// 查找类似 Gif图片 的本地化字符串。 /// diff --git a/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/Geometry_16x.png b/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/Geometry_16x.png new file mode 100644 index 0000000000000000000000000000000000000000..4075b3dc4cdb21c837e16a81a642b11cd37770ce GIT binary patch literal 470 zcmV;{0V)28P)9j7TypdAgD%_3NRiIohA2T$7hrma~j%IYKT9%ceJ|ToyBTnJNu~=-h zR4QF*KTg{VQmNEBoVe$Cvk2US$8=qvtJmv^WHPA)DScau00a}_2JPu$vG`)!_B;61 zb=@F7gW#s(Q1i_f;O0dkM2^lO(IqzQi9G5!PKCII=M=Zm>}vpS4uS&^mcSYIp!V}X zK1h9^{EQgD`*F2gf~NT|C=?1=$O(o+eDh?rT8*-YJ@PmF5w;ShacQ4`>~yQEgFR+~2r;|_sma+_Bk5L>LHfMT$y zEH4=ck09VMybNx$mQQHzhQr|%20!phBobL|?)8k-kEFckfxi$x0lNT?b9L2oy8r+H M07*qoM6N<$f?;ITrT_o{ literal 0 HcmV?d00001 diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/GeometryDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/GeometryDemoCtl.xaml new file mode 100644 index 00000000..88cf8319 --- /dev/null +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/GeometryDemoCtl.xaml @@ -0,0 +1,11 @@ + + + + + diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Styles/GeometryDemoCtl.xaml.cs b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/GeometryDemoCtl.xaml.cs new file mode 100644 index 00000000..d2af7c22 --- /dev/null +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Styles/GeometryDemoCtl.xaml.cs @@ -0,0 +1,34 @@ + +using HandyControl.Data; +using System; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Media; +using System.Windows.Shapes; + +namespace HandyControlDemo.UserControl +{ + public partial class GeometryDemoCtl + { + public GeometryDemoCtl() + { + InitializeComponent(); + GenerateGeometries(); + } + + public void GenerateGeometries() + { + ResourceDictionary dictionary = new ResourceDictionary(); + dictionary.Source = new Uri("pack://application:,,,/HandyControl;component/Themes/Basic/Geometries.xaml", UriKind.Absolute); + foreach (var item in dictionary.Keys) + { + StackPanel stack = new StackPanel { Margin = new Thickness(10) }; + TextBlock text = new TextBlock { Text = item.ToString(), HorizontalAlignment = HorizontalAlignment.Stretch }; + Path path = new Path { Width = 26, Height = 26, Data = TryFindResource(item.ToString()) as Geometry, Fill = TryFindResource(ResourceToken.PrimaryTextBrush) as Brush }; + stack.Children.Add(path); + stack.Children.Add(text); + panel.Children.Add(stack); + } + } + } +}