public EmployeeViewModel(MainViewModel mainViewModel) { mParentViewModel = mainViewModel; SubmitCommand = new DelegateCommand(() => ShowEditView()); _employeeService = (EmployeeService)SingletonInstances.GetService(typeof(EmployeeService)); _timeSheetService = (TimeSheetEntryService)SingletonInstances.GetService(typeof(TimeSheetEntryService)); _taskService = (TaskService)SingletonInstances.GetService(typeof(TaskService)); Task.Run(new Action(OnLoaded)); }
public TimeSheetViewModel(MainViewModel parentViewModel, EmployeeService employeeService, TimeSheetEntryService timeSheetEntryService, TaskService taskService) { this._parentViewModel = parentViewModel; this._employeeService = employeeService; this._timeSheetEntryService = timeSheetEntryService; this._taskService = taskService; AddNewRecordCommand = new DelegateCommand(AddRecord); SaveAllCommand = new DelegateCommand(SaveAllRecords); PrevWeekNavigationCommand = new DelegateCommand(new Action(() => { NavigateWeek("Previous"); })); NextWeekNavigationCommand = new DelegateCommand(new Action(() => { NavigateWeek("Next"); })); GoBackCommand = new DelegateCommand(GotoEmployeeView); _ = Task.Factory.StartNew(() => { LoadEmployeeData(); }); _ = Task.Factory.StartNew(() => { GetTaskDetails(); }); }