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 Show(string title) { _item.DisableDelete(true); _item.DisableRename(true); if (_view != null) { if (!string.IsNullOrEmpty(title)) { _view.Title = title; } // show work list button clicked > we're already on UI thread _view.Activate(); return; } ViewUtils.RunOnUIThread(() => { _view = WorkListViewFactory.CreateView(_worklist); _view.Owner = System.Windows.Application.Current.MainWindow; if (!string.IsNullOrEmpty(title)) { _view.Title = title; } _view.Closed += _view_Closed; _view.Show(); }); }