private void MoveRightTask(Task selectedTask) { Task parent = _selectedTask.Parent; var relevantParentSubTasks = TaskRepository.GetRelevantParentSubTasks(_selectedTask); int index = relevantParentSubTasks.IndexOf(_selectedTask); Task newParent = relevantParentSubTasks[index - 1]; _taskViewModel.MoveSubtask(_selectedTask, newParent); }
private void ShowTaskDetails(Task task) { var control = new TaskDetailControl(task); InsertAndShowControl(control); }
protected virtual void OnSelectedTaskChanged(Task task) { SelectedTaskChanged?.Invoke(task); }
private void UpdateSelectedTask(Task task) { _selectedTask = task; _menuContext.Task = task; OnSelectedTaskChanged(task); }
private void MenuItemClicked(object sender, string name) { switch (name) { case "MenuItemAdd": OnCreateTaskRequested(); break; case "MenuItemMoveUp": _taskViewModel.IncreasePriority(_selectedTask); break; case "MenuItemMoveDown": _taskViewModel.DecreasePriority(_selectedTask); break; case "MenuItemMoveLeft": Task newParent = _selectedTask.Parent.Parent; _taskViewModel.MoveSubtask(_selectedTask, newParent); break; case "MenuItemMoveRight": MoveRightTask(_selectedTask); break; case "MenuItemOpen": _taskViewModel.OpenTask(_selectedTask); break; case "MenuItemClose": _taskViewModel.CompleteTask(_selectedTask); break; case "MenuItemActivate": _taskViewModel.ActivateTask(_selectedTask); break; case "MenuItemPause": _taskViewModel.OpenTask(_selectedTask); break; case "MenuItemEdit": InsertAndShowControl(new TaskEditControl(_taskViewModel, _selectedTask)); break; case "MenuItemDelete": _taskViewModel.RemoveTask(_selectedTask); break; case "MenuItemShowActive": var actionManager = Shell.Instance.GetComponent <IActionManager>(); actionManager.ExecuteActionGuarded <ActiveTaskWindowAction>(_lifetime); break; case "MenuItemAddSubTask": InsertAndShowControl(new TaskEditControl(_taskViewModel, _selectedTask, true)); break; case "Backward": NavigateBackward(); break; case "Forward": NavigateForward(); break; case "MenuItemIconMenu": ShowMenuSettingsMenu(); break; default: break; } }