如何只显示一次页面 Windows Phone 8.1 运行时
How to show only once time page Windows Phone 8.1 Runtime
我想要一个页面只在应用程序启动后显示,下次转到首页screen.I我正在尝试查看 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");
}
}
这里可以检查应用是否是第一次启动(比如在phone上存储一个值),把对rootFrame.Navigate(typeof(MainPage), args.Arguments))
的调用替换成你的页面想导航到。
我想要一个页面只在应用程序启动后显示,下次转到首页screen.I我正在尝试查看 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");
}
}
这里可以检查应用是否是第一次启动(比如在phone上存储一个值),把对rootFrame.Navigate(typeof(MainPage), args.Arguments))
的调用替换成你的页面想导航到。