public TimesheetEntriesViewModel() { _service = new TimelyService(); _dialogService = DialogServiceProvider.Instance.DialogService; Users = new ObservableCollection <User>(_service.GetUsers()); Projects = new ObservableCollection <Project>(_service.GetProjects()); TimesheetEntries = new ObservableCollection <TimesheetEntry>(_service.GetTimesheetEntries()); AddTimesheetEntryCommand = new MyCommand(OnAddTimesheetEntry); EditTimesheetEntryCommand = new MyCommand(OnEditTimesheetEntry); DeleteTimesheetEntryCommand = new MyCommand(OnDeleteTimesheetEntry); }
public TimesheetEntriesViewModel(TimelyService service, IDialogService dialogService) { _service = service; _dialogService = dialogService; Users = new ObservableCollection <User>(_service.GetUsers()); Projects = new ObservableCollection <Project>(_service.GetProjects()); TimesheetEntries = new ObservableCollection <TimesheetEntry>(_service.GetTimesheetEntries()); AddTimesheetEntryCommand = new MyCommand(OnAddTimesheetEntry); EditTimesheetEntryCommand = new MyCommand(OnEditTimesheetEntry); DeleteTimesheetEntryCommand = new MyCommand(OnDeleteTimesheetEntry); }