Windows phone 8.1 在应用程序启动之前启动登录 ContentDialog
Windows phone 8.1 launch login ContentDialog on App Start before Mainpage
拜托,我是 windows phone 和任何其他平台开发的新手。我想使用 ContentDialog 向我的应用程序添加登录屏幕。我没有任何线索,也没有找到任何关于如何让它显示在主页之前的例子。
@kennyzx 感谢您将 link 指向我。这是锄头我通过将下面的代码放在我的 'App.xaml.cs'
中解决了我的问题
protected async override void OnWindowCreated(WindowCreatedEventArgs e)
{
//Lunch ContentDialog
LoginPage signInDialog = new LoginPage();
await signInDialog.ShowAsync();
if (signInDialog.Result == SignInResult.SignInOK)
{
// Sign in was successful.
}
else if (signInDialog.Result == SignInResult.SignInFail)
{
// Sign in failed.
// Exit the app after three attempts
Application.Current.Exit();
}
else if (signInDialog.Result == SignInResult.SignInCancel)
{
// Sign in was cancelled by the user.
// Exit the app
Application.Current.Exit();
}
}
拜托,我是 windows phone 和任何其他平台开发的新手。我想使用 ContentDialog 向我的应用程序添加登录屏幕。我没有任何线索,也没有找到任何关于如何让它显示在主页之前的例子。
@kennyzx 感谢您将 link 指向我。这是锄头我通过将下面的代码放在我的 'App.xaml.cs'
中解决了我的问题protected async override void OnWindowCreated(WindowCreatedEventArgs e)
{
//Lunch ContentDialog
LoginPage signInDialog = new LoginPage();
await signInDialog.ShowAsync();
if (signInDialog.Result == SignInResult.SignInOK)
{
// Sign in was successful.
}
else if (signInDialog.Result == SignInResult.SignInFail)
{
// Sign in failed.
// Exit the app after three attempts
Application.Current.Exit();
}
else if (signInDialog.Result == SignInResult.SignInCancel)
{
// Sign in was cancelled by the user.
// Exit the app
Application.Current.Exit();
}
}