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

@@ -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;
}
}