This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
rootFrame.PointerPressed += RootFrame_PointerPressed; | |
SystemNavigationManager.GetForCurrentView().BackRequested += OnBackRequested; | |
// Optional code to show back button on title bar | |
SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = | |
rootFrame.CanGoBack ? | |
AppViewBackButtonVisibility.Visible : | |
AppViewBackButtonVisibility.Collapsed; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
if (rootFrame == null) | |
{ | |
// Create a Frame to act as the navigation context and navigate to the first page | |
rootFrame = new Frame(); | |
rootFrame.NavigationFailed += OnNavigationFailed; | |
rootFrame.Navigated += OnNavigated; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private void OnNavigated(object sender, NavigationEventArgs e) | |
{ | |
// Each time a navigation event occurs, update the Back button's visibility | |
SystemNavigationManager.GetForCurrentView ().AppViewBackButtonVisibility = | |
((Frame)sender).CanGoBack ? | |
AppViewBackButtonVisibility.Visible : | |
AppViewBackButtonVisibility.Collapsed; | |
} | |
private void RootFrame_PointerPressed(object sender, PointerRoutedEventArgs e) |