Skip to content

Commit 3e95876

Browse files
committed
Supports incoming resource files
1 parent 615f119 commit 3e95876

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

src/WPFDevelopers.Samples.Shared/ExampleViews/ScreenCutExample.xaml.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,16 @@ private void Button_Click(object sender, RoutedEventArgs e)
3838
App.CurrentMainWindow.WindowState = WindowState.Minimized;
3939
//Thread.Sleep(1000);
4040
}
41-
ResourceDictionary resources = new ResourceDictionary();
42-
resources.Source = new Uri("pack://application:,,,/MyResources.xaml");
43-
screenCapturer = new ScreenCapture(resources: resources);
41+
42+
#region 无App.xaml情况,需引入资源文件
43+
//如没有App.xaml文件需要使用截图控件需要按照以下方式传入资源文件,具体查看
44+
//https://github.com/WPFDevelopersOrg/WPFDevelopers/issues/68
45+
//ResourceDictionary resources = new ResourceDictionary();
46+
//resources.Source = new Uri("pack://application:,,,/MyResources.xaml");
47+
//screenCapturer = new ScreenCapture(resources: resources);
48+
49+
#endregion
50+
screenCapturer = new ScreenCapture();
4451
screenCapturer.SnapCompleted += ScreenCapturer_SnapCompleted;
4552
screenCapturer.SnapCanceled += ScreenCapturer_SnapCanceled;
4653
screenCapturer.Capture();

0 commit comments

Comments
 (0)