2

The last time I developed against Windows Phone, it was with version 8. Now I'm making use of 8.1. Maybe this is a new feature from MS, but when I press the back button on the phone, regardless of how deep I'm into the app, the app minimizes. This is seriously annoying! Is there anything that I can do?

Many thanks in advance! Kind regards,

Richard Bailey
  • 2,658
  • 4
  • 27
  • 45
  • 1
    possible duplicate of [Windows Phone 8.1 Universal App terminates on navigating back from second page?](http://stackoverflow.com/questions/24335925/windows-phone-8-1-universal-app-terminates-on-navigating-back-from-second-page) – Igor Ralic Jan 26 '15 at 13:15

1 Answers1

3

Yes, this is the normal behaviour in Windows Phne 8.1 non-SL apps. Here a workaround to implement in your App.xaml.cs file:

public App()
{
    this.InitializeComponent();   
    HardwareButtons.BackPressed += HardwareButtons_BackPressed;        
}

void HardwareButtons_BackPressed(object sender, BackPressedEventArgs e)
{
    Frame rootFrame = Window.Current.Content as Frame;

    if (rootFrame != null && rootFrame.CanGoBack)
    {
        e.Handled = true;
        rootFrame.GoBack();
    }
}
fillobotto
  • 3,698
  • 5
  • 34
  • 58