Exemple #1
0
        public EditTaskViewModel(Task task, IQueryService <Task> taskQueryService, IQueryService <TaskState> taskStateQueryService)
        {
            _task     = task;
            TaskState = taskStateQueryService.GetByKey(task.State);

            var brushConverter = new BrushConverter();

            TaskStateColor = (Brush)brushConverter.ConvertFromString(TaskState.Color);

            _taskQueryService    = taskQueryService;
            _okCommand           = new RelayCommand(OnOkClick);
            _addTaskStateCommand = new RelayCommand(OnAddTaskStateClick);
            _deleteCommand       = new RelayCommand(OnDeleteClick);

            SelectUsersViewModel        = new SelectUsersViewModel(true);
            SelectTaskPriorityViewModel = new SelectTaskPriorityViewModel();

            _content = _task.Content;
            foreach (var user in _task.AssignedMembers)
            {
                SelectUsersViewModel.SelectedUsers.Add(user);
            }
            SelectTaskPriorityViewModel.SelectedTaskPriority = _task.Priority;
            SelectTaskPriorityViewModel.PropertyChanged     += SelectTaskPriorityViewModelOnPropertyChanged;
        }
Exemple #2
0
        public AddTaskViewModel(IQueryService <Task> taskQueryService, IQueryService <TaskState> taskStateQueryService)
        {
            _taskQueryService    = taskQueryService;
            _okCommand           = new RelayCommand(OnOkClick);
            _addTaskStateCommand = new RelayCommand(OnAddTaskStateClick);

            SelectUsersViewModel     = new SelectUsersViewModel(true);
            SelectTaskStateViewModel = new SelectTaskStateViewModel(taskStateQueryService);
            SelectTaskStateViewModel.PropertyChanged += SelectTaskStateViewModelOnPropertyChanged;
            SelectTaskPriorityViewModel = new SelectTaskPriorityViewModel();
            SelectTaskPriorityViewModel.PropertyChanged += SelectTaskPriorityViewModelOnPropertyChanged;
        }
Exemple #3
0
 public SetCurrentUserViewModel(CurrentUserViewModel currentUserViewModel)
 {
     _currentUserViewModel = currentUserViewModel;
     _okCommand            = new RelayCommand(OnOkClick);
     SelectUsersViewModel  = new SelectUsersViewModel(false);
 }