void StationListItemEndEdit(IEditableObject sender) { StationUIObject iTabObject = sender as StationUIObject; try { //if (iTabObject.TankId == 0) //{ // iTabObject.TankId = currTankId; //} // use the data access layer to update the wrapped data object dataAccessLayer.UpdateStation(iTabObject.GetDataObject()); iTabObject.NotifyIdChange(); } catch (Exception ex) { if (PersistenceError != null) { PersistenceError(this, ex); } } }
void StationListCollectionChanged(object sender, NotifyCollectionChangedEventArgs e) { if (e.Action == NotifyCollectionChangedAction.Remove) { try { foreach (object item in e.OldItems) { StationUIObject iTabObject = item as StationUIObject; // use the data access layer to delete the wrapped data object dataAccessLayer.DeleteStation(iTabObject.GetDataObject()); } } catch (Exception ex) { if (PersistenceError != null) { PersistenceError(this, ex); } } } }