0

When I go to the login page with this code.

 private void AppBarButton_Click_1(object sender, RoutedEventArgs e)
    {
        Frame.Navigate(typeof(LoginPage));
    }

But when I push the back button on the loginpage it does not go back to the first page. Did I do something wrong?

This is the code I use in my App.xaml.cs

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

        if (rootFrame != null && rootFrame.CanGoBack)
        {
            e.Handled = true;
            rootFrame.GoBack();
        }
    }

Fixed the issue by changing the blank pages to Basic pages. Now it will de all the backbutton navigation automatic.

  • 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) – Nguyen Kien Apr 15 '15 at 13:49
  • Thank you I tried out the solution and put it in my app.xaml.cs but it still won't work. – Lars Boerboom Apr 15 '15 at 14:13
  • Have you modified any of the code from the original project template? Are you using any libraries that might be swallowing the back button? – Peter Torr - MSFT Apr 15 '15 at 14:43
  • I did only edit the App.xaml.cs file. see edited post for the code. – Lars Boerboom Apr 16 '15 at 07:31
  • I fixed it I just changed all my pages to a basic page. Before that I just used a blank page and that was the issue. Thank you for all the answers. – Lars Boerboom Apr 16 '15 at 12:22

1 Answers1

0

Fixed the issue by changing the blank pages to Basic pages. Now it will de all the backbutton navigation automatic.