Skip to content

Instantly share code, notes, and snippets.

@scionwest
Created December 6, 2014 22:09
Show Gist options
  • Save scionwest/fc91fe9e9748764405a4 to your computer and use it in GitHub Desktop.
Save scionwest/fc91fe9e9748764405a4 to your computer and use it in GitHub Desktop.
App.Xaml.cs override
protected override void OnHardwareButtonsBackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)
{
var page = (Page)((Frame)Windows.UI.Xaml.Window.Current.Content).Content;
if (page is INavigateBackwards)
{
var firstRunPage = (INavigateBackwards)page;
if (!firstRunPage.CanNavigateBack())
{
e.Handled = true;
return;
}
}
base.OnHardwareButtonsBackPressed(sender, e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment