コード例 #1
0
        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);
        }
コード例 #2
0
        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);
        }