Skip to content

Instantly share code, notes, and snippets.

@scionwest
Created December 6, 2014 20:19
Show Gist options
  • Save scionwest/f823ecd4307f3109e0e6 to your computer and use it in GitHub Desktop.
Save scionwest/f823ecd4307f3109e0e6 to your computer and use it in GitHub Desktop.
Updated FirstRunPage
public sealed partial class FirstRunPage : VisualStateAwarePage
{
public FirstRunPage()
{
this.InitializeComponent();
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
//base.OnNavigatedTo(e);
#if WINDOWS_PHONE_APP
HardwareButtons.BackPressed += HardwareBack_OnPressed;
#endif
}
protected override void OnNavigatedFrom(NavigationEventArgs e)
{
//base.OnNavigatedFrom(e);
#if WINDOWS_PHONE_APP
HardwareButtons.BackPressed -= HardwareBack_OnPressed;
#endif
}
protected override void GoBack(object sender, RoutedEventArgs eventArgs)
{
return;
}
private void HardwareBack_OnPressed(object sender, BackPressedEventArgs e)
{
//Action handledCallback = () => e.Handled = true;
//var state = new Dictionary<string, object> { { "Callback", handledCallback } };
e.Handled = true;
// ((INavigationAware)this.DataContext).OnNavigatedTo("Back", NavigationMode.Back, state);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment