I've got a problem with navigate to next page in section:
protected override void OnNavigatedTo(NavigationEventArgs e)
{
Debug.WriteLine("Test1");
Frame.Navigate(typeof(LoginView));
Debug.WriteLine("Test2");
}
The method Frame.Navigate didn't work at all if only it's call in OnNavigatedTo. On debug I see "Test1" and "Test2" but nothing else happens. Any idea? The project: Windows Phone Store App 8.1
Add async keyword to OnNavigatedTo method and add await Task.Delay(10); before Frame.Navigate() call. Alternatively, you can execute Frame.Navigate() in Dispatcher.
1) using delay
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
await Task.Delay(10);
Frame.Navigate(typeof (LoginView));
}
2) using Dispatcher
protected override async void OnNavigatedTo(NavigationEventArgs e)
{
Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
{
Frame.Navigate(typeof(LoginView));
});
}