Disable Screen Capture and View Full Screen Mode in Windows 10 UWP

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.

  1. 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.
  1. var currentSize = ApplicationView.GetForCurrentView();  
  2. if (!currentSize.IsFullScreen)  
  3. {  
  4.     currentSize.TryEnterFullScreenMode();  
  5. }  
  6. else  
  7. {}  
If you need to set the size of the screen as your wish then try the following code.
  1. //to set the screen size  
  2. currentSize.TryResizeView(new Size(720, 540));  
If you need to exit the full screen use the ExitFullScreenMode method like the following code.

  1. //to exit the full screen size view  
  2. currentSize.ExitFullScreenMode();