Here are the steps:

Step 1: Open a blank app and add a Button and a TextBlock either from the toolbox or by copying the following XAML code into your grid.
  1. <StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
  2. <Button x:Name="captureButton" Content="Enable Capture" Click="captureButton_Click" />
  3. <TextBlock Name="status" Margin="0,10,0,0"></TextBlock>
  4. </StackPanel>

Step 2:

Copy and paste the following code to the cs page which will be called on button click event and will control the ScreenCapture and will show the status also:

  1. private void captureButton_Click(object sender, RoutedEventArgs e)
  2. {
  3. if (captureButton.Content.ToString() == "Enable Capture")
  4. {
  5. captureButton.Content = "Disable Capture";
  6. status.Text = "Screen Capturing is enabled";
  7. Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().IsScreenCaptureEnabled = true;
  8. }
  9. else
  10. {
  11. captureButton.Content = "Enable Capture";
  12. status.Text = "Screen Capturing is disabled";
  13. Windows.UI.ViewManagement.ApplicationView.GetForCurrentView().IsScreenCaptureEnabled = false;
  14. }
  15. }

When the ScreenCapture is disabled you will only get a black screen while trying to capture the same using any tool.

Step 3: Run your application and test yourself.