private void Button_Forget_User_Click(object sender, RoutedEventArgs e) { // Remove it from Microsoft Passport MicrosoftLoginHelper.RemovePassportAccountAsync(_activeUser); // Remove it from the local accounts list and resave the updated list UserHelper.RemoveUser(_activeUser); Debug.WriteLine("User " + _activeUser.Username + " deleted."); }
protected override async void OnNavigatedTo(NavigationEventArgs e) { // Check Microsoft Passport is setup and available on this machine if (await MicrosoftLoginHelper.MicrosoftLoginAvailableCheckAsync()) { } else { // Microsoft Passport is not setup so inform the user /*PassportStatus.Background = new SolidColorBrush(Windows.UI.Color.FromArgb(255, 50, 170, 207)); * PassportStatusText.Text = "Microsoft Passport is not setup!\n" + * "Please go to Windows Settings and set up a PIN to use it.";*/ PassSignInButton.IsEnabled = false; } }
private async void SignInPass() { if (UserHelper.ValidateUserCredentials(PasswordTextBox.Text)) { // Create and add a new local account _user = UserHelper.AddUser(PasswordTextBox.Text); Debug.WriteLine("Successfully signed in with traditional credentials and created local account instance!"); if (await MicrosoftLoginHelper.CreatePassKeyAsync(PasswordTextBox.Text)) { Debug.WriteLine("Successfully signed in with Microsoft Passport!"); Frame.Navigate(typeof(MainPage), _user); } } else { ErrorMessage.Text = "Invalid Credentials"; } }