void ObjectsItemEndEdit(IEditableObject sender) { PeriodicNonConventionalPlantsViewModel UIObject = sender as PeriodicNonConventionalPlantsViewModel; try { if (UIObject.Name != null) { PeriodicNonConventionalPlantsDataAccess.UpdatePeriodicNonConventionalPlant(UIObject.GetDataObject()); } } catch (Exception ex) { log.Error(ex.StackTrace); } }
void ObjectsCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (e.Action == NotifyCollectionChangedAction.Remove) { try { foreach (object item in e.OldItems) { PeriodicNonConventionalPlantsViewModel UIObject = item as PeriodicNonConventionalPlantsViewModel; PeriodicNonConventionalPlantsDataAccess.DeletePeriodicNonConventionalPlant(UIObject.GetDataObject()); } } catch (Exception ex) { log.Error(ex.StackTrace); } } }