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