コード例 #1
0
        void OnWorkspaceRequestClose(object sender, EventArgs e)
        {
            WorkspaceVmBase workspace = sender as WorkspaceVmBase;

            workspace.Dispose();
            this.MainTabs.Remove(workspace);
        }
コード例 #2
0
        public virtual void SetActiveWorkspace(WorkspaceVmBase workspace)
        {
            //Debug.Assert(this.MainTabs.Contains(workspace));

            //ICollectionView collectionView = CollectionViewSource.GetDefaultView(this.MainTabs);
            //if (collectionView == null) return;

            //var found = collectionView.MoveCurrentTo(workspace);
            if (!MainTabs.MakeCurrent(workspace))
            {
                Warn_n($"{GetType().Name} : MainWindowVMBase.SetActiveWorkspace()",
                       $"Workspace not found: “{workspace}”");
            }
        }
コード例 #3
0
        public void ShowTogether(WorkspaceVmBase naviVm
                                 , WorkspaceVmBase mainVm
                                 , WorkspaceVmBase othrVm)
        {
            if (naviVm != null)
            {
                naviVm.IsSelectedChanged += (s, e) =>
                {
                    if (e.Value)
                    {
                        MainTabs?.MakeCurrent(mainVm);
                        OtherTabs?.MakeCurrent(othrVm);
                    }
                };
            }

            if (mainVm != null)
            {
                mainVm.IsSelectedChanged += (s, e) =>
                {
                    if (e.Value)
                    {
                        NaviTabs?.MakeCurrent(naviVm);
                        OtherTabs?.MakeCurrent(othrVm);
                    }
                };
            }

            if (othrVm != null)
            {
                othrVm.IsSelectedChanged += (s, e) =>
                {
                    if (e.Value)
                    {
                        NaviTabs?.MakeCurrent(naviVm);
                        MainTabs?.MakeCurrent(mainVm);
                    }
                };
            }
        }