void ChangeUser_Click(object sender, RoutedEventArgs e)
{
Page outputFrame = (Page)rootPage.OutputFrame.Content;
Page inputFrame = (Page)rootPage.InputFrame.Content;
try
{
Windows.Security.Credentials.PasswordVault vault = new Windows.Security.Credentials.PasswordVault();
IReadOnlyList <PasswordCredential> creds = vault.RetrieveAll();
foreach (PasswordCredential c in creds)
{
try
{
vault.Remove(c);
}
catch (Exception Error) // Stored credential was deleted
{
DebugPrint(Error.ToString());
}
}
}
catch (Exception Error) // No stored credentials, so none to delete
{
DebugPrint(Error.ToString());
}
Reset1();
CleanCombobox();
CheckBox AuthenticationFailCheck = outputFrame.FindName("AuthenticationFailCheck") as CheckBox;
AuthenticationFailCheck.IsChecked = false;
TextBox WelcomeMessage = inputFrame.FindName("WelcomeMessage") as TextBox;
WelcomeMessage.Text = "User has been changed, please resign in with new credentials, choose save and launch scenario again";
}