private void AddNew_Click(object sender, EventArgs e) { var profileEditor = new Views.ProfileEditor(); var result = profileEditor.ShowDialog(); if (result == true) { _settings.Profiles.Add(profileEditor.Profile); _settings.Save(); LoadProfileItems(); } }
private void EditProfile_Click(object sender, RoutedEventArgs e) { var profile = Profiles.SelectedItem as Profile; if (profile != null) { var dialog = new ProfileEditor(profile); var result = dialog.ShowDialog(); if (result != null && result.Value == true) { _settings.Profiles.Remove(profile); _settings.Profiles.Add(dialog.Profile); _settings.Save(); LoadProfiles(); } } }