title: Handling Back Navigation Windows 10 (UWP)
body: <p>In my Xaml Page I've got a Frame.</p>
  
  <p>I'm trying to have a backButton event to just navigate inside frame .</p>
  
  <p>so I tried  to use this piece of code</p>
  
  <pre><code>public MainPage(){
      this.InitializeComponent();
      if(Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons")) {
          Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
      }
  }
  private void HardwareButtons_BackPressed(object sender,BackPressedEventArgs e) {
      if(insideFrame.CanGoBack())insideFrame.GoBack();
      else  Application.Current.Exit();
  }
  </code></pre>
  
  <p>but In phone after doing <code>HardwareButtons_BackPressed</code> event it close the application.</p>
  
  <p>It seems to running some default back button behavior on MainPage...</p>
  
  <p>How can I fix it? And In Windows10 does they add new events to handle back navigation?</p>
  
  <hr>
  
  <p>[Update]</p>
  
  <p>Now I found out it's better to Use <code>SystemNavigationManager</code> in Windows 10 instead of <code>Input.HardwareButtons.BackPressed</code>.</p>
  
  <pre><code>SystemNavigationManager currentView = SystemNavigationManager.GetForCurrentView();
  </code></pre>