您的典型模板生成App.xaml.cs在其OnLaunched方法中具有以下类似内容:
if (rootFrame.Content == null)
{
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}
Run Code Online (Sandbox Code Playgroud)
这是您导航到第一页的位置.对于第一次运行的特殊情况,请执行以下操作:
if (rootFrame.Content == null)
{
IPropertySet roamingProperties = ApplicationData.Current.RoamingSettings.Values;
if (roamingProperties.ContainsKey("HasBeenHereBefore"))
{
// The normal case
rootFrame.Navigate(typeof(MainPage), e.Arguments);
}
else
{
// The first-time case
rootFrame.Navigate(typeof(GreetingsPage), e.Arguments);
roamingProperties["HasBeenHereBefore"] = bool.TrueString; // Doesn't really matter what
}
}
Run Code Online (Sandbox Code Playgroud)
然后,问候页面应导航到您的设置页面,该页面应导航到您的主页面.
通过使用漫游设置,用户登录到其他计算机时将看不到第一次显示的屏幕.
| 归档时间: |
|
| 查看次数: |
1304 次 |
| 最近记录: |