public FilterConditionGroupViewModel(FilterViewModel parentFilter) { this.parentFilter = parentFilter; Conditions = new ObservableCollection<FilterConditionViewModel>(); IsEnabled = true; }
public FilterViewModel GetDuplicate() { FilterViewModel newFilter = new FilterViewModel(); newFilter.DisplayName = this.DisplayName + " (copy)"; newFilter.ConditionGroups = new ObservableCollection<FilterConditionGroupViewModel>(ConditionGroups.Select(cg => cg.GetDuplicate(newFilter))); return newFilter; }
public static FilterViewModel CreateNew() { FilterViewModel newFilter = new FilterViewModel(); newFilter.DisplayName = DateTime.Now.ToString(); FilterConditionGroupViewModel newGroup = new FilterConditionGroupViewModel(newFilter); newGroup.Conditions.Add(new FilterConditionViewModel(newGroup)); newFilter.ConditionGroups.Add(newGroup); return newFilter; }
public FilterConditionGroupViewModel GetDuplicate(FilterViewModel newParent) { FilterConditionGroupViewModel newGroup = new FilterConditionGroupViewModel(newParent); newGroup.Conditions = new ObservableCollection<FilterConditionViewModel>(this.Conditions.Select(c => c.GetDuplicate(newGroup))); newGroup.IsExclude = this.IsExclude; newGroup.IsEnabled = this.IsEnabled; return newGroup; }