title: Wiring up back button in NavigationView for UWP app
body: <p>I'm using a <code>NavigationView</code>in my UWP app and was trying to get the back button wired up for content changes. I have not been able to get the button enabled during content changes even if I set the enable property of the nav view. Currently I simply want to be able to navigate from the main view to a page then back to the main view. And also be able to navigate deeper into a stack so Main View -> New View -> New View and back up to the main view.</p>
  
  <p>MainPage.xaml/cs</p>
  
  <pre><code>&lt;NavigationView x:Name="MainView_NavigationView"
                      PaneTitle="Git Manager"
                      PaneDisplayMode="LeftCompact"
                      ItemInvoked="MainView_NavigationView_ItemInvoked"
                      Header="Git Manager"
                      BackRequested="MainView_NavigationView_BackRequested"&gt;
  
      &lt;NavigationView.AutoSuggestBox&gt;
          &lt;AutoSuggestBox PlaceholderText="Search"
                              QueryIcon="Find"/&gt;
      &lt;/NavigationView.AutoSuggestBox&gt;
  
      &lt;NavigationView.MenuItems&gt;
          &lt;NavigationViewItemSeparator/&gt;
          &lt;NavigationViewItemHeader Content="Information" /&gt;
          &lt;NavigationViewItemSeparator/&gt;
  
          &lt;NavigationViewItem x:Name="Login_NavViewItem" 
                                  Content="Login" 
                                  Tag="Clone Repositories" 
                                  Icon="AddFriend"/&gt;
  
          &lt;NavigationViewItem x:Name="Remote_NavViewItem" 
                                  Content="Remote" 
                                  Icon="World"/&gt;
  
          &lt;NavigationViewItem x:Name="Local_NavViewItem" 
                                  Content="Local" 
                                  Icon="Folder"/&gt;
  
          &lt;NavigationViewItem x:Name="Schedule_NavViewItem" 
                                  Content="Schedule" 
                                  Icon="Calendar"/&gt;
  
          &lt;NavigationViewItemSeparator/&gt;
      &lt;/NavigationView.MenuItems&gt;
  
      &lt;NavigationView.Content&gt;
          &lt;Frame x:Name="ContentFrame"&gt;
              &lt;Frame.ContentTransitions&gt;
                  &lt;TransitionCollection&gt;
                      &lt;NavigationThemeTransition /&gt;
                  &lt;/TransitionCollection&gt;
              &lt;/Frame.ContentTransitions&gt;
              &lt;Grid&gt;
                  &lt;TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" HorizontalTextAlignment="Center" TextAlignment="Center" Text="asdfasdfasdfasdf" /&gt;
              &lt;/Grid&gt;
          &lt;/Frame&gt;
      &lt;/NavigationView.Content&gt;
  &lt;/NavigationView&gt;
  </code></pre>
  
  <p>-</p>
  
  <pre><code>public sealed partial class MainPage : Page
      {
          public MainPage()
          {
              InitializeComponent();
          }
  
          private void MainView_NavigationView_ItemInvoked(NavigationView sender, NavigationViewItemInvokedEventArgs args)
          {
              if(args.IsSettingsInvoked)
              {
  
              }
              else
              {
                  NavigationViewItem item = args.InvokedItemContainer as NavigationViewItem;
  
                  switch(item.Content)
                  {
                      case "Login":
                          ContentFrame.Navigate(typeof(Views.Login));
                          break;
                      case "Remote":
                          ContentFrame.Navigate(typeof(Views.Remote));
                          break;
  
                      case "Local":
                          ContentFrame.Navigate(typeof(Views.Local));
                          break;
  
                      case "Schedule":
                          ContentFrame.Navigate(typeof(Views.Schedule));
                          break;
                  }
              }
          }
  
          private async void MainView_NavigationView_BackRequested(NavigationView sender, NavigationViewBackRequestedEventArgs args)
          {
              var contentBox = new ContentDialog();
              contentBox.Content = "Back clicked";
  
              await contentBox.ShowAsync();
          }
      }
  </code></pre>
  
  <p>The other pages are just new content pages that have a textblock on them. So my 2 questions are:</p>
  
  <p>How do I wire up the back button to actually be enabled and able to click it when I change my content or how I would navigate to a new page inside the navigation view to enable this button/functionlity.</p>
  
  <p>How do I use this to navigate nested pages back and forth?</p>