public override void RowSelected(UITableView tableView, NSIndexPath indexPath)
            {
                var m = GetRow(indexPath);

                if (m is TaskData)
                {
                    var data = (TaskData)m;
                    controller.Finish((TaskModel)data);
                }
                else if (m is ProjectAndTaskView.Project)
                {
                    var wrap = (ProjectAndTaskView.Project)m;
                    if (wrap.IsNoProject)
                    {
                        controller.Finish(workspace: new WorkspaceModel(wrap.WorkspaceId));
                    }
                    else if (wrap.IsNewProject)
                    {
                        var proj = (ProjectModel)wrap.Data;
                        // Show create project dialog instead
                        var next = new NewProjectViewController(proj.Workspace, proj.Color)
                        {
                            ProjectCreated = (p) => controller.Finish(project: p),
                        };
                        controller.NavigationController.PushViewController(next, true);
                    }
                    else
                    {
                        controller.Finish(project: (ProjectModel)wrap.Data);
                    }
                }
                else if (m is ProjectAndTaskView.Workspace)
                {
                    var wrap = (ProjectAndTaskView.Workspace)m;
                    controller.Finish(workspace: (WorkspaceModel)wrap.Data);
                }

                tableView.DeselectRow(indexPath, true);
            }
示例#2
0
        private void OnAddNewProject(object sender, EventArgs evt)
        {
            var newProjectController = new NewProjectViewController(viewModel.CurrentWorkspaceId, handler);

            NavigationController.PushViewController(newProjectController, true);
        }