Exemple #1
0
        private void AddNewTaskExecute()
        {
            //TODO open display box
            var newTask             = new ExecutableTask();
            var taskWindowViewModel = new TaskWindowViewModel(newTask);
            var taskWindow          = new TaskWindowView(taskWindowViewModel);

            taskWindow.Topmost = true;
            taskWindow.ShowDialog();

            if (taskWindowViewModel.IsModificationValidated)
            {
                _repository.AddNewExecutableTask(newTask);
                _taskList.Add(new ExecutableTaskViewModel(newTask));
            }
        }
Exemple #2
0
        private void OnDoubleClickExecute()
        {
            var selectedTask = SelectedTask.Model.Clone() as ExecutableTask;

            var taskWindowViewModel = new TaskWindowViewModel(selectedTask);
            var taskWindow          = new TaskWindowView(taskWindowViewModel);

            taskWindow.Topmost = true;
            taskWindow.ShowDialog();

            if (taskWindowViewModel.IsModificationValidated)
            {
                var newViewModel = new ExecutableTaskViewModel(selectedTask);
                TaskList.Remove(SelectedTask);
                TaskList.Add(newViewModel);
                _repository.SaveModifiedTask(selectedTask);
            }
        }