Hello,
I\'m working in a simple Windows 8 application with xaml and c#. I\'m using the VS 2012 templates to create pages, with navigation system included.
I\'m l
You can't Navigate
from within the OnNavigatedTo
method as the previous navigation method is still executing at that point. Instead, you can wait for it to be loaded by running the new navigation call via a dispatcher.
protected async override void OnNavigatedTo(NavigationEventArgs e)
{
//your other code
//...
Dispatcher.RunAsync(CoreDispatcherPriority.Normal,
() => Frame.Navigate(typeof(MainPage)));
}
The reason why it may work the first time in your code is because you're waiting for a few moments for the blogs to load. Within this time, the navigation method has completed loading and so it can be called again.
Having said that, consider if you really wanting a loading page and not just an overlay of some sort as Xyroid mentioned in the comments.