I have a Windows Phone 7.1 application in which I got three pages, and on each page I got 3 buttons: first one leading to page no. 1, second leading to page no. 2 and third leading to page no. 3.
The thing is that if I go to page 1 then page 2 – and then if I click on the first button to navigate to the first page a new instance of that page will be created. Instead of creating a new instance I would like to navigate to the existing instance of the page from the back stack.
Is it possible?
Yes, you need to navigate backwards manually by triggering a go back (mostly equivalent to the user pressing the back button):
NavigationService.GoBack();This will utilise the back stack as maintained by the OS. It will pop page 2 and re-instate page 1. Note that you cannot choose what page to go back to, it goes backwards one page if there is a page to back onto. So for example triggering a backwards navigation from page 3 will get you to page 2, you cannot pick page 1.
Alternatively, but not advised, you can in 7.1 pop pages off the back stack:
NavigationService.RemoveBackEntry();You could then manually navigate to the page. But seriously, try not to do that as it breaks user expectations, unless you manage page backing yourself.