void ObjectsItemEndEdit(IEditableObject sender) { UnidadPeriodoViewModel UIObject = sender as UnidadPeriodoViewModel; try { UnidadPeriodoDataAccess.UpdateUnidadPeriodo(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) { UnidadPeriodoViewModel UIObject = item as UnidadPeriodoViewModel; UnidadPeriodoDataAccess.DeleteUnidadPeriodo(UIObject.GetDataObject()); } } catch (Exception ex) { log.Error(ex.StackTrace); } } }