Any attempt to do the below in App.xaml.cs will result in “An object reference is required for the non-static field, method or property System.Windows.Navigation.NavigationService.Navigate(System.Uri)”
NavigationService.Navigate(new Uri("/Mainpage.xaml", UriKind.RelativeOrAbsolute));
Thus to ensure proper navigation within App.xaml.cs page, below is the right way.
(Application.Current.RootVisual as PhoneApplicationFrame).Navigate(new Uri("/Mainpage.xaml", UriKind.RelativeOrAbsolute));
The reason for doing so is that each application has only one Frame and it exposes the NavigationService. Thus NavigationService is always accessible as there will definitely be an instance of it for any Windows Phone app.