我希望仅在应用程序启动后显示页面,下一次进入主屏幕。我正在尝试浏览NavigationHelper,但不起作用!
签入您的App.xaml.cs文件,方法中应该包含类似于以下代码的内容OnLaunched
:
if (rootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
if (!rootFrame.Navigate(typeof(MainPage), args.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
在这里,您可以检查是否是首次启动该应用程序(例如,通过在手机上存储一个值),并使用rootFrame.Navigate(typeof(MainPage), args.Arguments))
您要导航到的页面来代替对的呼叫。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句