private bool SyncClockGroupMToFilterM(string oldGName, ClockGroupM g, FilterM f) { if (!f.IsBaseFilter && g.Name == f.GroupNames.FirstOrDefault()) { f.DisplayString = g.Name; f.IsSelected = g.IsSelected; f.IsBaseFilter = false; f.MyConstantImageSource = g.Icon; f.MyEmptyImageSource = MyClocks.FiltersVM.MyEmptyFolderIcon; f.MyNonEmptyImageSource = MyClocks.FiltersVM.MyNonEmptyFolderIcon; f.GroupNames.Clear(); f.GroupNames.Add(g.Name); f.UpdateItemCount(); } else { if (!f.GroupNames.Contains(oldGName)) { return(false); } var ng = new ObservableCollection <string>(f.GroupNames); ng.Remove(oldGName); ng.Add(g.Name); f.GroupNames = ng; f.DisplayString = g.Name; } return(true); }
public ClockGroupVM(ClockGroupM model) { Icon = model.Icon; Name = model.Name; DisplayString = model.Name; IsSelected = model.IsSelected; }
public ClockGroupVM(ClockGroupM m) : base() { M = m; M.PropertyChanged += M_PropertyChanged; SynchronizeFromModel(); PropertyChanged += ClockGroupVM_PropertyChanged; }
public bool Add(ClockGroupM item) { if (Contains(item.Name) || string.IsNullOrEmpty(item.Name)) { return(false); } item.PropertyChanged += M_PropertyChanged; //Ms.Insert(0, item); Ms.Add(item); return(true); }
public bool Add(ClockGroupM item) { if (item == null) { return(false); } if (Contains(item.Name) || string.IsNullOrEmpty(item.Name)) { return(false); } //Ms.Insert(0, item); Ms.Add(item); return(true); }
public bool Add(string item) { if (Contains(item) || string.IsNullOrEmpty(item)) { return(false); } var m = new ClockGroupM() { Name = item }; //Ms.Insert(0, m); Ms.Add(m); return(true); }