1

In my app, I have 3 pages:

  • MainPage
  • Page2
  • Page3

I want to go back from Page 3 to Page2 and to MainPage by Back device button. So How should I do it?

Help me, please!

The Light Spark
  • 504
  • 4
  • 19
Khai Le
  • 21
  • 2

2 Answers2

0

Navigation in WP 8.1 is totally different from the WP8, where here you only have to use Frame.Navigate and then give the Uri.

A perfect reference would be this.

Hope it helps!

Community
  • 1
  • 1
Kulasangar
  • 9,046
  • 5
  • 51
  • 82
0

Create an event for the hardware event like this:

Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;

And then handle the event accordingly:

void HardwareButtons_BackPressed(object sender, Windows.Phone.UI.Input.BackPressedEventArgs e)        
{
    Frame.Navigate(typeof(MainPage));   // page you want to navigate to
    e.Handled = true;
}

Hope this helps