I am building this application that will give the user some information based on the user’s name, age and location.
If the application is launched for the first time, i want to redirect the user to FirstTimePage.xaml where he can save his name, age and location.
if the user isnt opening the application for the first time, the application retrieves the name, age and location from Isolated Storage so there is no need to go to the FirstTimePage.xaml
Currently, I am checking on MainPage.xaml if the data on Isolated storage exist. If they exist, the user stays on MainPage.xaml. If they dont exist, the user is redirected to FirstTimePage.xaml.
My problem:
The first time the user will open the application, even if they are redirected to FirstTimePage.xaml, for a few frames they see the MainPage.xaml. Not even a second, but it is a little ugly. So I tried to put the “checking” code to app.xaml.cs (inside the codeblock that is executed when the application is launched)
The thing is that it doesnt recognises the Navigation code. It gives me an error at the bold word “NavigationService.Navigate….”
What can I do to solve my problem?
In order to control navigation you need to call the
Application.Current.RootFrameto gain access to theNavigationServiceprior to a page actually being loaded.See: Setting the start page for a more in depth discussion.