Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to I get access NavigationService in a WIndows Phone app without going through a PhoneApplicationPage?

How to I get access NavigationService in a Windows Phone app without going through a PhoneApplicationPage? My goal is to pass it to the application's primary view-model on startup, a technique that worked quite well for me in WPF and Silverlight.

like image 951
Jonathan Allen Avatar asked Jan 06 '12 00:01

Jonathan Allen


1 Answers

You can get it from the app's PhoneApplicationFrame. It will be accessible from anywhere in the app since every Windows Phone app has a Frame.

((PhoneApplicationFrame)Application.Current.RootVisual).Navigate(...);
like image 58
keyboardP Avatar answered Oct 05 '22 20:10

keyboardP