我遇到需要根据条件加载页面的情况:
条件是
if( First time application is launched){
Load aggrement page;
}
else{
Load main Page;
}
最好的方法是什么? 我应该检查一下条件:
private void Application_Launching(object sender, LaunchingEventArgs e)
{
}
或者在initializeCOmponent()调用之前的主页面中?
答案 0 :(得分:5)
尝试这样的事情:
private void Application_Launching(object sender, LaunchingEventArgs e)
{
IsolatedStorageSettings settings = IsolatedStorageSettings.ApplicationSettings;
if (settings.ContainsKey("isRanFirstTime"))
//Navigate to page 1
else
{
settings.Add("isRanFirstTime, 1);
//Navigate to page 2
}
}
关于从App.xaml.cs重定向导航,请在Peter Torr的帖子中找到更多信息