Navigate to another page at OnNavigatedTo?

前端 未结 1 1065
说谎
说谎 2021-01-22 12:17

Why does the method Navigate not work when called in the OnNavigatedTo event of this page?

Is this behavior reproducible for you?

Any ideas how to avoid this pro

相关标签:
1条回答
  • 2021-01-22 12:24

    To get the right behavior I am now using the dispatcher:

        this->Dispatcher->RunAsync(Windows::UI::Core::CoreDispatcherPriority::Normal, ref new Windows::UI::Core::DispatchedHandler([this] () {
            this->Frame->Navigate(Windows::UI::Xaml::Interop::TypeName(AnotherPage::typeid));
        }));
    
    0 讨论(0)
提交回复
热议问题