public TrackableItemsViewModel() { EditStatesCommand = new DelegateCommand(EditStates, x => true); service = UserContext.Service; try { TrackableItems = new ObservableCollection<TrackableItem>(); IList<TrackableItem> items = service.GetTrackableItems(UserContext.Session); //initially accepting all changes at all items //TODO: think about 'how to automate this process'? items.ToList().ForEach(x => { x.AcceptChanges(); TrackableItems.Add(x); }); } catch (Exception) { throw; } }
public TrackingsListViewModel() { ShowHistoryCommand = new DelegateCommand(ShowTrackingHistory, x => true); service = UserContext.Service; try { IList <ClientDataModel.Tracking> items = service.GetTrackings(UserContext.Session, null, null, ""); Trackings = new ObservableCollection <Tracking>(); foreach (var item in items) { Trackings.Add(item); } } catch (Exception) { throw; } }
public TrackableItemsViewModel() { EditStatesCommand = new DelegateCommand(EditStates, x => true); service = UserContext.Service; try { TrackableItems = new ObservableCollection <TrackableItem>(); IList <TrackableItem> items = service.GetTrackableItems(UserContext.Session); //initially accepting all changes at all items //TODO: think about 'how to automate this process'? items.ToList().ForEach(x => { x.AcceptChanges(); TrackableItems.Add(x); }); } catch (Exception) { throw; } }