Skip to content

Instantly share code, notes, and snippets.

🎯
Focusing

David Ballesteros reddvid

View GitHub Profile
View App.xaml.cs
...
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;
View mouse-snips.cs
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;
View mouse-snip (Methods).cs
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)
You can’t perform that action at this time.