2

为什么在本页的OnNavigatedTo事件中调用Navigate方法不起作用?

这种行为对你来说可以重现吗?

任何想法如何避免这个问题?

void LockScreenPage::OnNavigatedTo(Windows::UI::Xaml::Navigation::NavigationEventArgs^ e)
{
    //if user has no PIN protection
    this->Frame->Navigate(Windows::UI::Xaml::Interop::TypeName(AnotherPage::typeid));

    //else verify PIN
}
4

1 回答 1

7

为了获得正确的行为,我现在使用调度程序:

    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));
    }));
于 2012-11-14T12:01:03.180 回答