public void OnNewItemAdded(object sender, SomeEntityEventArgs e)
 {
     var entityVM = new EntityViewModel(e.Entity);
     Items.Add(entityVM);
     SelectedItem = entityVM;
     _itemAdded = true;
     _service.Add(e.Entity);
 }
Пример #2
0
        public void OnNewItemAdded(object sender, SomeEntityEventArgs e)
        {
            var entityVM = new EntityViewModel(e.Entity);

            Items.Add(entityVM);
            SelectedItem = entityVM;
            _itemAdded   = true;
            _service.Add(e.Entity);
        }
Пример #3
0
 public void OnItemEdited(object sender, SomeEntityEventArgs e)
 {
     _itemAdded = false;
     _service.Update(e.Entity);
     Items.Clear();
     foreach (var entity in _service.GetThingsOrdered())
     {
         Items.Add(new EntityViewModel(entity));
     }
 }
 public void OnItemEdited(object sender, SomeEntityEventArgs e)
 {
     _itemAdded = false;
     _service.Update(e.Entity);
     Items.Clear();
     foreach (var entity in _service.GetThingsOrdered())
     {
         Items.Add(new EntityViewModel(entity));
     }
 }
Пример #5
0
 public void Delete(object sender, SomeEntityEventArgs entity)
 {
     Items.Remove(Items.Single(o => o.Id == entity.Entity.Id));
 }
 public void Delete(object sender, SomeEntityEventArgs entity)
 {
     Items.Remove(Items.Single(o => o.Id == entity.Entity.Id));
 }