add Screenshot Demo

This commit is contained in:
NaBian committed 2020-03-07 21:58:46 +08:00
1 parent 46b1297aa7
commit 4113f9d814
23 files changed
+187 -41

No files matched your search

@@ -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", "" ]
]
}
]
@@ -190,6 +190,9 @@
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\RunningBlockDemoCtl.xaml.cs">
<DependentUpon>RunningBlockDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\ScreenshotDemoCtl.xaml.cs">
<DependentUpon>ScreenshotDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\ScrollViewerDemoCtl.xaml.cs">
<DependentUpon>ScrollViewerDemoCtl.xaml</DependentUpon>
</Compile>
@@ -684,6 +687,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\ScreenshotDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\ScrollViewerDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -1176,15 +1176,6 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 概览 的本地化字符串。
/// </summary>
public static string Overview {
get {
return ResourceManager.GetString("Overview", resourceCulture);
}
}
/// <summary>
/// 查找类似 页码条 的本地化字符串。
/// </summary>
@@ -1491,6 +1482,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 截图 的本地化字符串。
/// </summary>
public static string Screenshot {
get {
return ResourceManager.GetString("Screenshot", resourceCulture);
}
}
/// <summary>
/// 查找类似 滚动视图 的本地化字符串。
/// </summary>
@@ -1608,6 +1608,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 开始截图 的本地化字符串。
/// </summary>
public static string StartScreenshot {
get {
return ResourceManager.GetString("StartScreenshot", resourceCulture);
}
}
/// <summary>
/// 查找类似 保持打开 的本地化字符串。
/// </summary>
@@ -738,4 +738,10 @@
<data name="PracticalDemos" xml:space="preserve">
<value>Practical demos</value>
</data>
<data name="StartScreenshot" xml:space="preserve">
<value>Start screenshot</value>
</data>
<data name="Screenshot" xml:space="preserve">
<value>Screenshot</value>
</data>
</root>
@@ -738,4 +738,10 @@
<data name="PracticalDemos" xml:space="preserve">
<value>Practical demos</value>
</data>
<data name="StartScreenshot" xml:space="preserve">
<value>Start screenshot</value>
</data>
<data name="Screenshot" xml:space="preserve">
<value>Screenshot</value>
</data>
</root>
@@ -738,4 +738,10 @@
<data name="PracticalDemos" xml:space="preserve">
<value>Practical demos</value>
</data>
<data name="StartScreenshot" xml:space="preserve">
<value>Start screenshot</value>
</data>
<data name="Screenshot" xml:space="preserve">
<value>Screenshot</value>
</data>
</root>
@@ -738,4 +738,10 @@
<data name="PracticalDemos" xml:space="preserve">
<value>Practical demos</value>
</data>
<data name="StartScreenshot" xml:space="preserve">
<value>Start screenshot</value>
</data>
<data name="Screenshot" xml:space="preserve">
<value>Screenshot</value>
</data>
</root>
@@ -738,4 +738,10 @@
<data name="PracticalDemos" xml:space="preserve">
<value>实用例子</value>
</data>
<data name="StartScreenshot" xml:space="preserve">
<value>开始截图</value>
</data>
<data name="Screenshot" xml:space="preserve">
<value>截图</value>
</data>
</root>
Binary file not shown.

After

Width:  |  Height:  |  Size: 207 B

@@ -0,0 +1,10 @@
<UserControl x:Class="HandyControlDemo.UserControl.ScreenshotDemoCtl"
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"
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
Background="{DynamicResource RegionBrush}">
<hc:TransitioningContentControl>
<Button Content="{x:Static langs:Lang.StartScreenshot}" Command="hc:ControlCommands.StartScreenshot"/>
</hc:TransitioningContentControl>
</UserControl>
@@ -0,0 +1,33 @@
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using HandyControl.Controls;
using HandyControl.Data;
namespace HandyControlDemo.UserControl
{
public partial class ScreenshotDemoCtl : IDisposable
{
public ScreenshotDemoCtl()
{
InitializeComponent();
Screenshot.Snapped += Screenshot_Snapped;
}
private void Screenshot_Snapped(object sender, FunctionEventArgs<ImageSource> e)
{
new HandyControl.Controls.Window
{
Content = new Image
{
Source = e.Info,
Stretch = Stretch.None
},
WindowStartupLocation = WindowStartupLocation.CenterScreen
}.ShowDialog();
}
public void Dispose() => Screenshot.Snapped -= Screenshot_Snapped;
}
}
@@ -3,7 +3,7 @@
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit"
x:Class="HandyControlDemo.UserControl.MainContent">
<Grid Name="GridMain" MinHeight="300" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="16">
<Grid Name="GridMain" MinHeight="300" MinWidth="200" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="16">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition/>