private void OnRemoveClick(object sender, RoutedEventArgs e) {
if (ProfileList.Items.Count == 1) {
DialogManager.ShowErrorDialog(LanguageManager.Model.Settings_LastProfile);
return;
}
Profile profile = SelectedProfile;
if (ProfileList.SelectedIndex != ProfileList.Items.Count - 1) {
ProfileList.SelectedIndex++;
} else {
ProfileList.SelectedIndex--;
}
if (ProfileManager.RemoveProfile(profile)) {
Credentials.Remove(profile);
}
}