void ObjectsItemEndEdit(IEditableObject sender) { RecursoUnidadViewModel UIObject = sender as RecursoUnidadViewModel; try { RecursoUnidadDataAccess.UpdateRecursoUnidad(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) { RecursoUnidadViewModel UIObject = item as RecursoUnidadViewModel; RecursoUnidadDataAccess.DeleteRecursoUnidad(UIObject.GetDataObject()); } } catch (Exception ex) { log.Error(ex.StackTrace); } } }