Beispiel #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();
 }
Beispiel #2
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);
        }
Beispiel #3
0
        public void ExecutedActivateDocumentCommand(object sender,
                                                    ExecutedRoutedEventArgs e)
        {
            ManagedContent doc = e.Parameter as ManagedContent;

            if (doc != null)
            {
                if (!DocumentTabPanel.GetIsHeaderVisible(doc))
                {
                    DocumentPane parentPane = doc.ContainerPane as DocumentPane;
                    parentPane.Items.Remove(doc);
                    parentPane.Items.Insert(0, doc);
                }
                ////doc.IsSelected = true;
                ////Selector.SetIsSelected(doc, true);
                //if (this.GetManager() != null)
                //    this.GetManager().ActiveContent = doc;
                doc.SetAsActive();
            }
        }