I'm creating a Windows Phone 8.1 app.
I'm OK with simple navigation using Frame.navigate(typeof(mypage));
and it seems to be working fine.
I want to do some database processing on MainPage
then when finished go to Page1
.
Using an event handler on button click works fine but I've put the navigation code at the end of the OnNavigatedTo
function after my processing. Page1 doesn't load, although a debug writeline statement before and after both work so I know it's running.
I'm sure there is an obvious reason or fix, could anyone help?
try wrap the navigation code in
await Windows.ApplicationModel.Core.CoreApplication.MainView.CoreWindow.Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal, () =>
{
// Navigate to page 1 here
});
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.