示例#1
0
        /// <summary>
        /// Event raised when the ActiveDocument or ActivePane property has changed.
        /// </summary>
        private static void ActiveDocumentOrPane_PropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            var            c = (AvalonDockHost)d;
            ManagedContent managedContent = null;

            if (e.NewValue != null &&
                c.contentMap.TryGetValue(e.NewValue, out managedContent))
            {
                managedContent.Activate();
            }
        }
示例#2
0
        public static void BringDocumentHeaderToView(this ManagedContent document)
        {
            if (!DocumentTabPanel.GetIsHeaderVisible(document))
            {
                DocumentPane parentPane = document.ContainerPane as DocumentPane;
                if (parentPane != null)
                {
                    parentPane.Items.Remove(document);
                    parentPane.Items.Insert(0, document);
                    document.Activate();
                }
            }

            ////document.IsSelected = true;
            ////Selector.SetIsSelected(document, true);
            //if (this.GetManager() != null)
            //    this.GetManager().ActiveContent = document;
            //document.SetAsActive();
        }