public void WorkListAdded(IWorkList workList) { if (WorkList != null) { return; } RunOnUIThread(() => { var tuple = WorkListViewFactory.CreateView(workList); _view = tuple.Item1; ViewModel = tuple.Item2; WorkList = workList; //if (workList is SelectionWorkList) //{ // _viewModel = new SelectionWorkListVm(workList); // _view = new WorkListView(_viewModel as SelectionWorkListVm) // {Title = workList.Name}; // _workList = workList; //} //if (workList is IssueWorkList) //{ // _viewModel = new IssueWorkListVm(workList); // _view = new IssueWorkListView(_viewModel as IssueWorkListVm) // {Title = workList.Name}; // _workList = workList; //} }); }
public void WorkListRemoved(IWorkList workList) { if (ViewModel == null) { return; } if (!EnsureWorkListsMatch(workList, ViewModel.CurrentWorkList)) { return; } RunOnUIThread(() => { _view?.Close(); WorkList = null; ViewModel = null; _view = null; }); }