Пример #1
0
 public CategoryViewModel(ItemViewModel i)
     : this()
 {
     this.Name = i.Category;
     Items.Add(i);
 }
Пример #2
0
 private void AddToViewModelCollection(ItemViewModel ivm)
 {
     AddToViewModelCollection(ivm);
 }
Пример #3
0
 private void AddToViewModelCollection(ItemViewModel ivm)
 {
     try
     {
         Items.Add(ivm);
     }
     catch { }
 }
Пример #4
0
 public CountItem(ItemViewModel i)
 {
     this.Model = i;
     Stock = Model.Stock;
 }
Пример #5
0
 private ItemViewModel AddNewItem(Item i)
 {
     ItemViewModel ivm = new ItemViewModel(i);
     ivm.PropertyChanged += ivm_PropertyChanged;
     AddToMatchingCategory(ivm);
     AddToViewModelCollection(ivm);
     return ivm;
 }
Пример #6
0
 private void AddNewCategory(ItemViewModel ivm = null)
 {                
     CategoryViewModel cvm = ivm != null ? new CategoryViewModel(ivm) : new CategoryViewModel();
     Categories.Add(cvm);
 }
Пример #7
0
 private CategoryViewModel AddToMatchingCategory(ItemViewModel ivm)
 {
     CategoryViewModel cvm = Categories.FirstOrDefault(x => x.Name == ivm.Category);
     if (cvm == null)
     {
         AddNewCategory(ivm);
     }
     else
         cvm.Items.Add(ivm);
     SelectedCategory = cvm;
     return cvm;
 }
Пример #8
0
 protected virtual void ItemListViewModel_ItemAdded(object sender, ItemEventArgs e)
 {
     ItemViewModel ivm = new ItemViewModel(e.Item);
     AddToViewModelCollection(ivm);
     RaisePropertyChangedForAll();
 }
 internal SelectedItemChangedEventArgs(ItemViewModel ivm = null)
 {
     this.Selected = ivm;
 }