private void OnProfileSelectionChanged(object sender, SelectionChangedEventArgs e) {
if (SelectedProfile == null) {
return;
}
ValidatePaths();
NotifyPropertyChanged("IsSelectedNotDefault");
NotifyPropertyChanged("ProfileLauncher");
LoginData login = null;
IsPreventLoginChange = true;
if (Credentials.TryGetValue(SelectedProfile, out login)) {
if (pbPass != null) {
if (login.SecurePassword != null) {
pbPass.Password = "empty_pass";
} else {
pbPass.Clear();
}
}
if (tbUser != null) {
tbUser.Text = login.User;
}
if (ManualLoginSupported != null) {
ManualLoginSupported.IsChecked = login.IsManual;
}
} else {
if (tbUser != null) {
tbUser.Clear();
}
if (pbPass != null) {
pbPass.Clear();
}
if (ManualLoginSupported != null) {
ManualLoginSupported.IsChecked = false;
}
}
IsPreventLoginChange = false;
}