Disable screen capture
If you are develop any security apps, sometimes we will need to disable to take screenshots of your app. This feature was available in Windows 10 app. You need to call the ViewManagement class ad get the properties of current view screen.
Next set the screen capture boo value properties to false like the following code.
- Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().IsScreenCaptureEnabled = false;
Now run the app and take screen shot it will appear as black screen.
View full screen mode
Next we are going to see how to show your app screen as full screen mode because you will see by default windows 10 app open as initial size. If you need to open the app as full screen or required size then we can achieve this by using the following code,
Add the namespace using Windows.UI.ViewManagement;
Next create a news instance to get the application current view properties. Then set the full screen mode as like the following code.
- var currentSize = ApplicationView.GetForCurrentView();
- if (!currentSize.IsFullScreen)
- {
- currentSize.TryEnterFullScreenMode();
- }
- else
- {}
If you need to set the size of the screen as your wish then try the following code.
-
- currentSize.TryResizeView(new Size(720, 540));
If you need to exit the full screen use the ExitFullScreenMode method like the following code.
-
- currentSize.ExitFullScreenMode();