void ObjectsItemEndEdit(IEditableObject sender) { PeriodicAreaViewModel UIObject = sender as PeriodicAreaViewModel; try { if (UIObject.Name != null) { PeriodicAreasDataAccess.UpdatePeriodicArea(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) { PeriodicAreaViewModel UIObject = item as PeriodicAreaViewModel; PeriodicAreasDataAccess.DeletePeriodicArea(UIObject.GetDataObject()); } } catch (Exception ex) { log.Error(ex.StackTrace); } } }