Exemplo n.º 1
0
 public override void Activate()
 {
     if (State == DockableContentState.AutoHide)
     {
         if (Manager != null && this.IsLoaded)
         {
             Manager.ShowFlyoutWindow(this, null);
         }
     }
     else if (State == DockableContentState.Document)
     {
         if (!DocumentTabPanel.GetIsHeaderVisible(this))
         {
             DocumentPane parentPane = this.ContainerPane as DocumentPane;
             if (parentPane != null &&
                 parentPane.GetManager() != null &&
                 parentPane.Items.IndexOf(this) != 0)
             {
                 parentPane.Items.Remove(this);
                 parentPane.Items.Insert(0, this);
                 parentPane.SelectedIndex = 0;
             }
         }
     }
     base.Activate();
 }
Exemplo n.º 2
0
        internal void CheckContentsEmpty()
        {
            if (Items.Count == 0)
            {
                bool isMainDocPaneToBeClosed = IsMainDocumentPane.HasValue &&
                                               IsMainDocumentPane.Value;

                if (isMainDocPaneToBeClosed)
                {
                    DockingManager manager = GetManager();
                    DocumentPane   candidateNewMainDocPane = manager.FindAnotherLogicalChildContained <DocumentPane>(this);
                    if (candidateNewMainDocPane != null &&
                        candidateNewMainDocPane.GetManager() == this.GetManager())
                    {
                        ResizingPanel containerPanel = Parent as ResizingPanel;
                        if (containerPanel != null)
                        {
                            containerPanel.RemoveChild(this);
                        }

                        manager.MainDocumentPane = candidateNewMainDocPane;
                        candidateNewMainDocPane.NotifyPropertyChanged("IsMainDocumentPane");
                    }
                }
                else
                {
                    ResizingPanel containerPanel = Parent as ResizingPanel;
                    if (containerPanel != null)
                    {
                        containerPanel.RemoveChild(this);
                    }
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// Activate the document showing its header if it's not visible
        /// </summary>
        public override void Activate()
        {
            base.Activate();

            if (!DocumentTabPanel.GetIsHeaderVisible(this))
            {
                DocumentPane parentPane = this.ContainerPane as DocumentPane;
                if (parentPane != null &&
                    parentPane.GetManager() != null &&
                    parentPane.Items.IndexOf(this) != 0)
                {
                    parentPane.Items.Remove(this);
                    parentPane.Items.Insert(0, this);
                    parentPane.SelectedIndex = 0;
                }
            }

            //Active this content as the active document
            if (Manager != null)
            {
                Manager.ActiveDocument = this;
            }

            //ensure this content is rendered first
            Panel.SetZIndex(this, 2);
        }