From 4113f9d81489a09c1d4a79d240db5afbbca757e0 Mon Sep 17 00:00:00 2001 From: NaBian <836904362@qq.com> Date: Sat, 7 Mar 2020 21:58:46 +0800 Subject: [PATCH] add Screenshot Demo --- .../HandyControlDemo_Core_GE30.csproj | 3 + .../HandyControlDemo_Net_40.csproj | 3 + .../HandyControlDemo_Net_GE45.csproj | 3 + .../HandyControlDemo_Code.csproj | 7 +++ .../Data/DemoInfo.json | 3 +- .../HandyControlDemo_Shared.projitems | 7 +++ .../Properties/Langs/Lang.Designer.cs | 27 ++++++--- .../Properties/Langs/Lang.en.resx | 6 ++ .../Properties/Langs/Lang.fa.resx | 6 ++ .../Properties/Langs/Lang.fr.resx | 6 ++ .../Properties/Langs/Lang.ko-KR.resx | 6 ++ .../Properties/Langs/Lang.resx | 6 ++ .../LeftMainContent/WindowScreenshot_16x.png | Bin 0 -> 207 bytes .../Controls/ScreenshotDemoCtl.xaml | 10 ++++ .../Controls/ScreenshotDemoCtl.xaml.cs | 33 +++++++++++ .../UserControl/Main/MainContent.xaml | 2 +- .../Controls/Screenshot/Screenshot.cs | 7 +-- .../Controls/Screenshot/ScreenshotWindow.cs | 56 ++++++++++-------- .../HandyControl_Shared.projitems | 1 + .../Interactivity/Commands/ControlCommands.cs | 5 ++ .../Commands/ScreenshotCommand.cs | 15 +++++ .../Commands/StartScreenshotCommand.cs | 15 +++++ .../Tools/Helper/WindowHelper.cs | 1 + 23 files changed, 187 insertions(+), 41 deletions(-) create mode 100644 src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/WindowScreenshot_16x.png create mode 100644 src/Shared/HandyControlDemo_Shared/UserControl/Controls/ScreenshotDemoCtl.xaml create mode 100644 src/Shared/HandyControlDemo_Shared/UserControl/Controls/ScreenshotDemoCtl.xaml.cs create mode 100644 src/Shared/HandyControl_Shared/Interactivity/Commands/ScreenshotCommand.cs create mode 100644 src/Shared/HandyControl_Shared/Interactivity/Commands/StartScreenshotCommand.cs diff --git a/src/Core_GE30/HandyControlDemo_Core_GE30/HandyControlDemo_Core_GE30.csproj b/src/Core_GE30/HandyControlDemo_Core_GE30/HandyControlDemo_Core_GE30.csproj index 75007053..a599d3eb 100644 --- a/src/Core_GE30/HandyControlDemo_Core_GE30/HandyControlDemo_Core_GE30.csproj +++ b/src/Core_GE30/HandyControlDemo_Core_GE30/HandyControlDemo_Core_GE30.csproj @@ -480,6 +480,9 @@ Resources\Img\cloud.png + + Resources\Img\LeftMainContent\WindowScreenshot_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 50bbc0a2..0efba4ca 100644 --- a/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj +++ b/src/Net_40/HandyControlDemo_Net_40/HandyControlDemo_Net_40.csproj @@ -547,6 +547,9 @@ Resources\Img\cloud.png + + Resources\Img\LeftMainContent\WindowScreenshot_16x.png + 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 abe74897..0dae1c8d 100644 --- a/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj +++ b/src/Net_GE45/HandyControlDemo_Net_GE45/HandyControlDemo_Net_GE45.csproj @@ -610,6 +610,9 @@ Resources\Img\cloud.png + + Resources\Img\LeftMainContent\WindowScreenshot_16x.png + diff --git a/src/Shared/HandyControlDemo_Code/HandyControlDemo_Code.csproj b/src/Shared/HandyControlDemo_Code/HandyControlDemo_Code.csproj index db149ee9..d307144e 100644 --- a/src/Shared/HandyControlDemo_Code/HandyControlDemo_Code.csproj +++ b/src/Shared/HandyControlDemo_Code/HandyControlDemo_Code.csproj @@ -317,6 +317,9 @@ UserControl\Controls\RunningBlockDemoCtl.xaml + + UserControl\Controls\ScreenshotDemoCtl.xaml + UserControl\Controls\ScrollViewerDemoCtl.xaml @@ -713,6 +716,10 @@ UserControl\Controls\RunningBlockDemoCtl.xaml.cs RunningBlockDemoCtl.xaml + + UserControl\Controls\ScreenshotDemoCtl.xaml.cs + ScreenshotDemoCtl.xaml + UserControl\Controls\ScrollViewerDemoCtl.xaml.cs ScrollViewerDemoCtl.xaml diff --git a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json index c849557e..69a6b1da 100644 --- a/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json +++ b/src/Shared/HandyControlDemo_Shared/Data/DemoInfo.json @@ -98,6 +98,7 @@ [ "Sprite", "SpriteDemoCtl", "HandyControl", "" ], [ "Notification", "NotificationDemoCtl", "Procedure_16x", "" ], [ "Dialog", "DialogDemoCtl", "Dialog_16x", "" ], + [ "Screenshot", "ScreenshotDemoCtl", "WindowScreenshot_16x", "1" ], [ "Window", "WindowDemoCtl", "WindowsForm_16x", "1" ] ] }, @@ -106,7 +107,7 @@ "demoItemList": [ [ "HatchBrushGenerator", "HatchBrushGeneratorDemoCtl", "DataGenerator_16x", "" ], [ "Morphing Animation", "GeometryAnimationDemoCtl", "Animation_16x", "" ], - [ "Effects", "EffectsDemoCtl", "Effects_16x", "1" ] + [ "Effects", "EffectsDemoCtl", "Effects_16x", "" ] ] } ] \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems index ef1f20e3..9bb9f927 100644 --- a/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems +++ b/src/Shared/HandyControlDemo_Shared/HandyControlDemo_Shared.projitems @@ -190,6 +190,9 @@ RunningBlockDemoCtl.xaml + + ScreenshotDemoCtl.xaml + ScrollViewerDemoCtl.xaml @@ -684,6 +687,10 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs index bd30d1fd..e3078682 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.Designer.cs @@ -1176,15 +1176,6 @@ namespace HandyControlDemo.Properties.Langs { } } - /// - /// 查找类似 概览 的本地化字符串。 - /// - public static string Overview { - get { - return ResourceManager.GetString("Overview", resourceCulture); - } - } - /// /// 查找类似 页码条 的本地化字符串。 /// @@ -1491,6 +1482,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 截图 的本地化字符串。 + /// + public static string Screenshot { + get { + return ResourceManager.GetString("Screenshot", resourceCulture); + } + } + /// /// 查找类似 滚动视图 的本地化字符串。 /// @@ -1608,6 +1608,15 @@ namespace HandyControlDemo.Properties.Langs { } } + /// + /// 查找类似 开始截图 的本地化字符串。 + /// + public static string StartScreenshot { + get { + return ResourceManager.GetString("StartScreenshot", resourceCulture); + } + } + /// /// 查找类似 保持打开 的本地化字符串。 /// diff --git a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx index 24edac67..97bad55c 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.en.resx @@ -738,4 +738,10 @@ Practical demos + + Start screenshot + + + Screenshot + \ 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 73fd70c6..b1d3c4fe 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fa.resx @@ -738,4 +738,10 @@ Practical demos + + Start screenshot + + + Screenshot + \ 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 c8051c46..3c22a942 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.fr.resx @@ -738,4 +738,10 @@ Practical demos + + Start screenshot + + + Screenshot + \ 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 9715066f..88562ce8 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.ko-KR.resx @@ -738,4 +738,10 @@ Practical demos + + Start screenshot + + + Screenshot + \ 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 a64229fb..f4e63998 100644 --- a/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx +++ b/src/Shared/HandyControlDemo_Shared/Properties/Langs/Lang.resx @@ -738,4 +738,10 @@ 实用例子 + + 开始截图 + + + 截图 + \ No newline at end of file diff --git a/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/WindowScreenshot_16x.png b/src/Shared/HandyControlDemo_Shared/Resources/Img/LeftMainContent/WindowScreenshot_16x.png new file mode 100644 index 0000000000000000000000000000000000000000..45e78d9f63fd79f1c7e9350a758b47cd7c64cb29 GIT binary patch literal 207 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`oCO|{#S9F5he4R}c>anMpkSk? zi(^Pd+}Vi-IS(iZumlHXZI~a?W~-7LF@w|c+w6jV(RYPKC%qFNw%imfeaQ6TPp9CL zDf?2w4&GenktTX2>i72(x`vG%YZzwbd1=-t%+-|Q-g0J*n`gEYW=YHNGZfPOqo@?+l=07(8A5T-G@yGywoC C^h`eh literal 0 HcmV?d00001 diff --git a/src/Shared/HandyControlDemo_Shared/UserControl/Controls/ScreenshotDemoCtl.xaml b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/ScreenshotDemoCtl.xaml new file mode 100644 index 00000000..85767c53 --- /dev/null +++ b/src/Shared/HandyControlDemo_Shared/UserControl/Controls/ScreenshotDemoCtl.xaml @@ -0,0 +1,10 @@ + + +