WP7 - BackKeyPress

Aug 6, 2010 at 8:43 AM

Hi nroute master !

I would like to know how can I use the back button to navigate between views ?

What is the best approach for navigation in a wp7 app ? using UserControls or Pages ?

Thanks for your answers


Aug 19, 2010 at 11:16 AM
Sorry this question slipped through my mail, right so, the best approach given the current limitation of having to use the build-in controls is to use either of the following approaches: 1. Use a PhoneApplicationPage shell and within it you host your NavigationContainer and then trap the BackKeyPress to navigate back in the container. I did something similar in the "Square Away" WP7 game demo, have a look at the PlayStateCancelHandledAction behavior. The important thing though would be to ensure that when no more navigation pages to back-into you give way to the application. And with this you can use either UserControls or Pages - even share them with SL from the desktop. 2. Extend or create an navigation adapter for PhoneApplicationFrame, this way you use the built-in controls whilst using nRoute to do the navigation. I'm looking into having this formally supported in the next release, and the benefit of this approach should be able that you get the back-key press support automatically. Hope this helps, Rishi