Please I am new to windows phone and any other platform development. I want to add a login screen to my app using ContentDialog. I have no clue and have found nothing by way of example on how to make it show before the mainpage.
1 回答
1
@kennyzx 感谢您将链接指向我。这是锄头我通过将下面的代码放在我的“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();
}
}
于 2015-04-25T03:51:45.020 回答