private void HandleGlobalProfile([NotNull] object sender, [NotNull] RoutedEventArgs e) { Assert.ArgumentNotNull(sender, "sender"); Assert.ArgumentNotNull(e, "e"); var globalProfileDialog = new ProfileOptionsEditDialog("Global") { DataContext = new ProfileOptionsViewModel("Global", SettingsHolder.Instance.Settings.GlobalGroups), Owner = this, }; globalProfileDialog.Show(); globalProfileDialog.Closed += (s, a) => { SettingsHolder.Instance.SaveCommonSettings(); }; }
private void EditProfile([NotNull] object obj) { Assert.ArgumentNotNull(obj, "obj"); var owner = obj as Window; if (SelectedProfile == null) { return; } var profile = SettingsHolder.Instance.GetProfile(SelectedProfile.NameProfile).Clone(); var profileOptionDialog = new ProfileOptionsEditDialog(SelectedProfile.NameProfile) { DataContext = new ProfileOptionsViewModel(profile), Owner = owner, }; profileOptionDialog.Show(); }