예제 #1
0
        private static void OnDockTreeSizeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DockTreeClient dockTreeClient = (DockTreeClient)d;

            if (dockTreeClient._isInitBinding)
            {
                return;
            }

            Dock dock;
            DependencyProperty dp = e.Property;

            if (dp == LeftDockTreeWidthProperty)
            {
                dock = Dock.Left;
            }
            else if (dp == RightDockTreeWidthProperty)
            {
                dock = Dock.Right;
            }
            else if (dp == TopDockTreeHeightProperty)
            {
                dock = Dock.Top;
            }
            else
            {
                Debug.Assert(dp == BottomDockTreeHeightProperty);
                dock = Dock.Bottom;
            }

            dockTreeClient.GetDockTreeSplit(dock).UpdateSplitterDistance();
        }
예제 #2
0
        private void OnIsVisibleChanged()
        {
            DockTreeSplit parentSplit = DockTreeClient.GetParentSplit(this);

            if (parentSplit != null)
            {
                parentSplit.InvalidateState();
            }
        }
예제 #3
0
 internal void Dispose()
 {
     ClearValue(Child1PropertyKey);
     ClearValue(Child2PropertyKey);
     _dockTreeClient = null;
     DockControl     = null;
     ClearValue(OrientationPropertyKey);
     ClearValue(IsSplitterTopLeftPropertyKey);
     _flagUpdateSplitterDistance = true;
     ClearValue(SplitterDistanceProperty);
     _flagUpdateSplitterDistance = false;
 }
예제 #4
0
        private static void OnDockTreeZOrderChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DockTreeClient dockTreeClient = (DockTreeClient)d;

            if (dockTreeClient._isInitBinding)
            {
                return;
            }

            dockTreeClient.DockControl.SaveFocus();
            dockTreeClient.InitializeSplits();
            dockTreeClient.DockControl.RestoreFocus();
        }
예제 #5
0
        void Refresh()
        {
            if (DockControl == null)
            {
                return;
            }

            LeftSplitterWidth    = ConvertSplitterSize(DockControl.LeftDockTree.IsVisible);
            RightSplitterWidth   = ConvertSplitterSize(DockControl.RightDockTree.IsVisible);
            TopSplitterHeight    = ConvertSplitterSize(DockControl.TopDockTree.IsVisible);
            BottomSplitterHeight = ConvertSplitterSize(DockControl.BottomDockTree.IsVisible);

            IsLeftGuideVisible     = DockManager.GetShowsLeftGuide(DockControl);
            IsRightGuideVisible    = DockManager.GetShowsRightGuide(DockControl);
            IsTopGuideVisible      = DockManager.GetShowsTopGuide(DockControl);
            IsBottomGuideVisible   = DockManager.GetShowsBottomGuide(DockControl);
            IsDocumentGuideVisible = DockManager.GetShowsFillGuide(DockControl);

            LeftTreeWidth = RightTreeWidth = TopTreeHeight = BottomTreeHeight = new GridLength();
            DockTreeClient dockTreeClient = FindVisualChild <DockTreeClient>(DockControl);

            foreach (DockTreeControl dockTreeControl in FindVisualChildren <DockTreeControl>(dockTreeClient))
            {
                DockTree dockTree = dockTreeControl.DockTree;
                if (dockTree == null)
                {
                    continue;
                }
                if (dockTree.Position == DockTreePosition.Left)
                {
                    LeftTreeWidth = new GridLength(dockTreeControl.ActualWidth);
                }
                else if (dockTree.Position == DockTreePosition.Right)
                {
                    RightTreeWidth = new GridLength(dockTreeControl.ActualWidth);
                }
                else if (dockTree.Position == DockTreePosition.Top)
                {
                    TopTreeHeight = new GridLength(dockTreeControl.ActualHeight);
                }
                else if (dockTree.Position == DockTreePosition.Bottom)
                {
                    BottomTreeHeight = new GridLength(dockTreeControl.ActualHeight);
                }
            }
        }
예제 #6
0
        private static void OnIsVisibleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            DockTreeClient dockTreeClient = (DockTreeClient)d;

            if (dockTreeClient._isInitBinding)
            {
                return;
            }

            DockTree           dockTree;
            DependencyProperty dp = e.Property;

            if (dp == LeftDockTreeIsVisibleProperty)
            {
                dockTree = dockTreeClient.DockControl.LeftDockTree;
            }
            else if (dp == RightDockTreeIsVisibleProperty)
            {
                dockTree = dockTreeClient.DockControl.RightDockTree;
            }
            else if (dp == TopDockTreeIsVisibleProperty)
            {
                dockTree = dockTreeClient.DockControl.TopDockTree;
            }
            else if (dp == BottomDockTreeIsVisibleProperty)
            {
                dockTree = dockTreeClient.DockControl.BottomDockTree;
            }
            else
            {
                Debug.Assert(dp == DocumentDockTreeIsVisibleProperty);
                dockTree = dockTreeClient.DockControl.DocumentDockTree;
            }

            dockTreeClient.GetParentSplit(dockTree).InvalidateState();
        }
예제 #7
0
        internal DockTreeSplit(DockTreeClient dockTreeClient, Dock position, DockTreeSplit nextSplit)
        {
            _dockTreeClient = dockTreeClient;
            DockControl     = dockTreeClient.DockControl;
            Position        = position;

            if (position == Dock.Left)
            {
                Child1 = DockControl.GetDockTree(DockPositionHelper.GetDockControlTreePosition(position));
                if (nextSplit != null)
                {
                    Child2 = nextSplit;
                }
                else
                {
                    Child2 = DockControl.GetDockTree(DockControlTreePosition.Document);
                }
                Orientation       = Orientation.Horizontal;
                IsSplitterTopLeft = true;
            }
            else if (position == Dock.Right)
            {
                Child2 = DockControl.GetDockTree(DockPositionHelper.GetDockControlTreePosition(position));
                if (nextSplit != null)
                {
                    Child1 = nextSplit;
                }
                else
                {
                    Child1 = DockControl.GetDockTree(DockControlTreePosition.Document);
                }
                Orientation       = Orientation.Horizontal;
                IsSplitterTopLeft = false;
            }
            else if (position == Dock.Top)
            {
                Child1 = DockControl.GetDockTree(DockPositionHelper.GetDockControlTreePosition(position));
                if (nextSplit != null)
                {
                    Child2 = nextSplit;
                }
                else
                {
                    Child2 = DockControl.GetDockTree(DockControlTreePosition.Document);
                }
                Orientation       = Orientation.Vertical;
                IsSplitterTopLeft = true;
            }
            else
            {
                Debug.Assert(position == Dock.Bottom);
                Child2 = DockControl.GetDockTree(DockPositionHelper.GetDockControlTreePosition(position));
                if (nextSplit != null)
                {
                    Child1 = nextSplit;
                }
                else
                {
                    Child1 = DockControl.GetDockTree(DockControlTreePosition.Document);
                }
                Orientation       = Orientation.Vertical;
                IsSplitterTopLeft = false;
            }

            UpdateSplitterDistance();
        }