Skip to content

Instantly share code, notes, and snippets.

@scionwest
Created December 6, 2014 21:12
Show Gist options
  • Save scionwest/588f57d1b275f045190f to your computer and use it in GitHub Desktop.
Save scionwest/588f57d1b275f045190f to your computer and use it in GitHub Desktop.
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.GetType() == typeof(FirstRunPage))
{
var firstRunPage = (FirstRunPage)page;
if (firstRunPage.CanGoBack())
{
e.Handled = false;
}
else
{
e.Handled = true;
}
}
base.OnHardwareButtonsBackPressed(sender, e);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment