I have inherited some Windows Phone code that I must change. I need to show the user a tutorial about how to use the application when he first launches it. However, I cannot manage to change the current view…
Here is my code:
public LoginView()
{
InitializeComponent();
this.DataContext = new LoginViewModel();
if (ApplicationFirstLaunched() == true)
{
NavigationManager.Current.Navigate(ApplicationView.DemoView);
}
}
The ApplicationFirstLaunched function works fine (I use IsolatedStorageSettings to store a boolean value), but the view never changes.. I thought that maybe the Navigate call was wrong so I created a button in my view and assigned its Click property to this function:
private void demoBtn_Click(object sender, RoutedEventArgs e)
{
NavigationManager.Current.Navigate(ApplicationView.DemoView);
}
When I click the button, the view changes and the tutorial pops up. What to do to show another view at first launch? Thanks
Navigate in the OnNavigatedTo method.