Exemple #1
0
        /// <summary>
        /// Invoked when a new <see cref="ContentPane"/> has been created and needs to be added to the appropriate target collection.
        /// </summary>
        /// <param name="pane">The pane that was created and needs to be added to the appropriate collection</param>
        protected virtual void AddPane(ContentPane pane)
        {
            DocumentContentHost host = _target as DocumentContentHost;

            if (host != null)
            {
                ContentPane  sibling = GetSiblingDocument();
                TabGroupPane tgp     = null;

                if (sibling != null)
                {
                    tgp = LogicalTreeHelper.GetParent(sibling) as TabGroupPane;
                    Debug.Assert(null != tgp, "Expected all documents to be within a tab group pane.");
                }

                if (null == tgp)
                {
                    SplitPane sp = new SplitPane();
                    tgp = new TabGroupPane {
                        Name = "Z" + Guid.NewGuid().ToString("N")
                    };
                    sp.Panes.Add(tgp);
                    DocumentContentHost dch = host;
                    dch.Panes.Add(sp);
                }

                tgp.Items.Add(pane);
                RaiseInitializeContentPane(pane);
            }
            else
            {
                IList targetCollection = null;

                Debug.Assert(_target == null || !string.IsNullOrEmpty((string)_target.GetValue(FrameworkElement.NameProperty)),
                             "The Name should be set so the container will not be removed when all the panes have been moved elsewhere. Otherwise new panes may not be displayed.");

                SplitPane splitPane = _target as SplitPane;
                if (splitPane != null)
                {
                    targetCollection = splitPane.Panes;
                }
                else
                {
                    TabGroupPane target = _target as TabGroupPane;
                    if (target != null)
                    {
                        targetCollection = target.Items;
                    }
                }

                if (null != targetCollection)
                {
                    targetCollection.Add(pane);

                    RaiseInitializeContentPane(pane);
                }
            }
        }
Exemple #2
0
        public void ShowDocumentWindow(object viewModel, object context = null, bool selectWhenShown = true)
        {
            ContentPane  dockableWindow = CreateDockable(viewModel, context);
            TabGroupPane host           = XamDockManagerHelper.FindTabGroupPane(GetDockingManager());

            host.Items.Add(dockableWindow);

            if (selectWhenShown)
            {
                dockableWindow.Activate();
            }
        }
Exemple #3
0
        /// <summary>
        /// Invoked when a new <see cref="ContentPane"/> has been created and needs to be added to the appropriate target collection.
        /// </summary>
        /// <param name="pane">The pane that was created and needs to be added to the appropriate collection</param>
        protected virtual void AddPane(ContentPane pane)
        {
            DocumentContentHost host = _target as DocumentContentHost;
            if(host != null)
            {
                ContentPane sibling = GetSiblingDocument();
                TabGroupPane tgp = null;

                if(sibling != null)
                {
                    tgp = LogicalTreeHelper.GetParent(sibling) as TabGroupPane;
                    Debug.Assert(null != tgp, "Expected all documents to be within a tab group pane.");
                }

                if(null == tgp)
                {
                    SplitPane sp = new SplitPane();
                    tgp = new TabGroupPane { Name = "Z" + Guid.NewGuid().ToString("N") };
                    sp.Panes.Add(tgp);
                    DocumentContentHost dch = host;
                    dch.Panes.Add(sp);
                }

                tgp.Items.Add(pane);
                RaiseInitializeContentPane(pane);
            }
            else
            {
                IList targetCollection = null;

                Debug.Assert(_target == null || !string.IsNullOrEmpty((string)_target.GetValue(FrameworkElement.NameProperty)),
                    "The Name should be set so the container will not be removed when all the panes have been moved elsewhere. Otherwise new panes may not be displayed.");

                SplitPane splitPane = _target as SplitPane;
                if(splitPane != null)
                {
                    targetCollection = splitPane.Panes;
                }
                else
                {
                    TabGroupPane target = _target as TabGroupPane;
                    if(target != null)
                    {
                        targetCollection = target.Items;
                    }
                }

                if(null != targetCollection)
                {
                    targetCollection.Add(pane);

                    RaiseInitializeContentPane(pane);
                }
            }
        }
 internal TabGroupPaneProxy()
 {
     _tabGroupPane = new TabGroupPane();
     _contentPaneProxies = new List<ContentPaneProxy>();
 }