private void Add_Click(object sender, RoutedEventArgs e) { var dlg = new FilterWindow(new Filter()); dlg.Owner = this; if (!dlg.ShowDialog().GetValueOrDefault()) { return; } bool added = App.Current.Settings.AddFilter(null, dlg.Filter); App.Current.Settings.SerializeToConfiguration(); if (added) { _context.Filters.Add(dlg.Filter); } }
private void ModifyFilter(Filter filter) { if (filter == null) { return; } var dlg = new FilterWindow(filter.Clone()); dlg.Owner = this; if (!dlg.ShowDialog().GetValueOrDefault()) { return; } App.Current.Settings.AddFilter(filter, dlg.Filter); App.Current.Settings.SerializeToConfiguration(); }