I am writing a phone application on Windows 10. I’m using the hamburger menu in the application, so I couldn’t manage the standard navigation through Frame because this is a stupid transition to a new page, and when using the menu hamburger I need to insert the page into <SplitView.Content> wrote my class for navigation, in desktop mode, all navigation works fine, but when I started testing on the phone and in tablet mode, the system back button doesn’t work as I wanted when I click on the system back button, the previous page returns, but The life comes down ... Help how to deceive her? can it be possible to fill the Frame without going through the pages? PS destPage is a change with the name of the page, for example typeof (Enter) ; HamburgerMenu is the name of <SplitView> ; App.NavigationHistory is a Stack<Type> for recording transitions. An example of my navigation code if needed:

  internal class AppNavigation { internal static void SetBackButtonVisibility() { if (App.NavigationHistory.Count > 0) { SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible; } else { SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed; } } internal static void SetSplitViewContent(SplitView HamburgerMenu, Type destPage, bool push) { if (push) { var type = HamburgerMenu.Content?.GetType(); if (destPage != type) { AddToBackStack(type); HamburgerMenu.Content = (UserControl)Activator.CreateInstance(destPage); } } else { HamburgerMenu.Content = (UserControl)Activator.CreateInstance(RemoveFromBackStack()); } } internal static void AddToBackStack(Type type) { App.NavigationHistory.Push(type); SetBackButtonVisibility(); } internal static Type RemoveFromBackStack() { var type = App.NavigationHistory.Pop(); SetBackButtonVisibility(); return type; } } 

    1 answer 1

    I added this reaction to pressing the button back to the main page of the App.xaml.cs application.

      protected override void OnLaunched(LaunchActivatedEventArgs e) { SystemNavigationManager.GetForCurrentView().BackRequested += App_BackRequested;} private void App_BackRequested(object sender, BackRequestedEventArgs e) { if (!e.Handled) { var mainPage = (Window.Current.Content as Frame)?.Content as MainPage; var HamburgerMenu = mainPage?.FindName("HamburgerMenu") as SplitView; AppNavigation.SetSplitViewContent(HamburgerMenu, null, false); e.Handled = true; } }