Skip to content

Instantly share code, notes, and snippets.

View reddvid's full-sized avatar
🎯
Focusing

David Ballesteros reddvid

🎯
Focusing
View GitHub Profile
...
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;
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;
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)