コード例 #1
0
        /// <summary>
        /// Transfers the windows manager contents after desealization has finished
        /// </summary>
        /// <param name="windowsManager">The windows manager.</param>
        private void TransferWindowsManagerContents(WindowsManager windowsManager)
        {
            windowsManager.Clear();

            // Transfer auto hide and pinned windows for all dock points);
            foreach (Dock dockPosition in DockPositions)
            {
                DockedWindows dockedWindows = _dockedWindows[dockPosition];

                foreach (DockPane pinnedPane in dockedWindows.PinnedPanes)
                {
                    windowsManager.AddPinnedWindow(pinnedPane, dockPosition);
                }

                foreach (DockPane autoHidePane in dockedWindows.AutoHidePanes)
                {
                    windowsManager.AddAutoHideWindow(autoHidePane, dockPosition);
                }
            }

            // Transfer floating windows
            foreach (DockPane floatingPane in _floatingWindows)
            {
                windowsManager.AddFloatingWindow(floatingPane);
            }

            // Transfer document content
            switch (_rootContainer.State)
            {
            case DocumentContainerState.Empty:
                break;

            case DocumentContainerState.ContainsDocuments:
                List <object> documents = new List <object>(_rootContainer.Documents);
                _rootContainer.Clear();
                foreach (object document in documents)
                {
                    if (document is DocumentContent)
                    {
                        DocumentContent documentContent = (document as DocumentContent);
                        documentContent.DetachDockPane();
                        windowsManager.DocumentContainer.AddDocument(documentContent.DockPane);
                    }
                }
                break;

            case DocumentContainerState.SplitHorizontally:
                TransferDocumentGrid(windowsManager, true);
                break;

            case DocumentContainerState.SplitVertically:
                TransferDocumentGrid(windowsManager, false);
                break;

            default:
                throw new ArgumentOutOfRangeException();
            }
        }
コード例 #2
0
        private DockPane CreateContainer()
        {
            DockPane pane = new DockPane();

            pane.MinHeight = 100;
            pane.MinWidth  = 200;
            pane.MaxWidth  = 400;
            pane.Header    = "Visual Property Page";
            Grid g = new Grid();

            g.Background = Brushes.DarkGray;
            g.Children.Add(t_visualPropertyPage);
            pane.Content = g;

            pane.Close += Pane_Close;

            t_manager.AddPinnedWindow(pane, Dock.Right);

            return(pane);
        }