Пример #1
0
 private void MenuNav_BackRequested(NavigationView sender, NavigationViewBackRequestedEventArgs args)
 {
     if (MainContentFrame.CanGoBack)
     {
         MainContentFrame.GoBack();
     }
 }
Пример #2
0
 /// <summary>
 /// Return to the previous frame
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Back_Click(object sender, RoutedEventArgs e)
 {
     if (MainContentFrame.CanGoBack)
     {
         if (MainContentFrame.BackStack.Count == 0)
         {
             SelectHamburgerOption("BrowseItem", true);
         }
         else
         {
             PageStackEntry page = MainContentFrame.BackStack.ElementAt(MainContentFrame.BackStack.Count - 1);
             HamburgerOptions.SelectionChanged -= HamburgerOptions_SelectionChanged;
             if (page.SourcePageType == typeof(Browse))
             {
                 SelectHamburgerOption("BrowseItem", false);
                 Title.Text = "Browse";
             }
             else if (page.SourcePageType == typeof(YourMusic))
             {
                 SelectHamburgerOption("YourMusicItem", false);
                 Title.Text = "Your Music";
             }
             else if (page.SourcePageType == typeof(Profile))
             {
                 SelectHamburgerOption("ProfileItem", false);
                 Title.Text = "Profile";
             }
             else if (page.SourcePageType == typeof(Search))
             {
                 SelectHamburgerOption("SearchItem", false);
                 Title.Text = "Search";
             }
             else if (page.SourcePageType == typeof(Settings))
             {
                 SelectHamburgerOption("SettingsItem", false);
                 Title.Text = "Settings";
             }
             HamburgerOptions.SelectionChanged += HamburgerOptions_SelectionChanged;
         }
         MainContentFrame.GoBack();
     }
 }