cfi*_*her 2 c++ events microsoft-metro c++-cx winrt-xaml
为什么在此页面的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
}
Run Code Online (Sandbox Code Playgroud)
为了获得正确的行为,我现在正在使用调度程序:
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));
}));
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2157 次 |
| 最近记录: |