title: How to handle back button for only on a certain page?
body: <p>In short, I would like to handle the back button only on certain page to go back to previous page, but ignore (let default operation/ close the app) on the rest of the pages.</p>
  
  <p>So for my example, I would like to handle back button only for CurrentPage. So, I put this code on my CurrentPage.xaml.cs</p>
  
  <pre><code>public CurrentPage()
  {
     this.InitializeComponent();
     SystemNavigationManager.GetForCurrentView().BackRequested += App_BackRequested;
  }
  
  private void App_BackRequested(object sender, BackRequestedEventArgs e)
  {
     this.Frame.Navigate(typeof(PreviousPage), e);
     e.Handled = true;
  }
  </code></pre>
  
  <p>But, when I got into PreviousPage, pressing Back Button will go to PreviousPage again. I cannot quit the app.</p>
  
  <p>If I add this on the PreviousPage.xaml.cs, then pressing BackButton from CurrentPage will result to go back to PreviousPage and close the app automatically.</p>
  
  <pre><code>public PreviousPage()
  {
     this.InitializeComponent();
     SystemNavigationManager.GetForCurrentView().BackRequested += App_BackRequested;
  }
  
  private void App_BackRequested(object sender, BackRequestedEventArgs e)
  {
     Application.Current.Exit();
     e.Handled = true;
  }
  </code></pre>
  
  <p>Do you have any idea how to handle back button on single page?</p>