protected override void OnGotMouseCapture(MouseEventArgs eventArgs)
        {
            base.OnGotMouseCapture(eventArgs);

            if (Mouse.Captured != this)
                return;

            _borderIndicators = new BorderIndicators(this)
            {
                Owner = Window.GetWindow(this),
                Topmost = true,
                AllowDockLeft = AllowDockLeftBorderCheckBox.IsChecked ?? false,
                AllowDockRight = AllowDockRightBorderCheckBox.IsChecked ?? false,
                AllowDockTop = AllowDockTopBorderCheckBox.IsChecked ?? false,
                AllowDockBottom = AllowDockBottomBorderCheckBox.IsChecked ?? false,
                AllowDockInside = false,
            };

            _paneIndicators = new PaneIndicators(this)
            {
                Owner = Window.GetWindow(this),
                Topmost = true,
                AllowDockLeft = AllowDockLeftCheckBox.IsChecked ?? false,
                AllowDockRight = AllowDockRightCheckBox.IsChecked ?? false,
                AllowDockTop = AllowDockTopCheckBox.IsChecked ?? false,
                AllowDockBottom = AllowDockBottomCheckBox.IsChecked ?? false,
                AllowDockInside = AllowDockCenterCheckBox.IsChecked ?? false,
            };

            _borderIndicators.Show();
            _paneIndicators.Show();
        }
        private void ShowBorderDockIndicators()
        {
            Debug.Assert(_dockControl != null);

            if (_borderDockIndicators == null)
            {
                // The visible drop target buttons are determined by the DockStrategy.
                _borderDockIndicators = new BorderIndicators(_dockControl)
                {
                    AllowDockInside = false,
                    AllowDockLeft = CanDock(null, DockPosition.Left),
                    AllowDockTop = CanDock(null, DockPosition.Top),
                    AllowDockRight = CanDock(null, DockPosition.Right),
                    AllowDockBottom = CanDock(null, DockPosition.Bottom),
                };
                _borderDockIndicators.Show();
            }

            // Bring border DockIndicators to front, otherwise they might be behind the
            // previews (semi-transparent rectangles) of the pane DockIndicators.
            var hWnd = new WindowInteropHelper(_borderDockIndicators).Handle;
            Win32.SetWindowPos(hWnd, IntPtr.Zero, 0, 0, 0, 0, SetWindowPosFlags.SWP_NOMOVE | SetWindowPosFlags.SWP_NOSIZE | SetWindowPosFlags.SWP_SHOWWINDOW | SetWindowPosFlags.SWP_NOACTIVATE);

            // Alternative:
            //_borderDockIndicators.Topmost = true;
            //_borderDockIndicators.Topmost = false;
        }
Beispiel #3
0
        private void ShowPaneIndicators(FrameworkElement targetElement)
        {
            Debug.Assert(targetElement != null);

            if (_paneDockIndicators != null && _paneDockIndicators.Target == targetElement)
            {
                return;
            }

            HidePaneIndicators();

            // The visible drop target buttons are determined by the DockStrategy.
            // For DockAnchorPanes only the inside button is visible.
            bool isAnchorPane = targetElement is DockAnchorPane;

            _paneDockIndicators = new PaneIndicators(targetElement)
            {
                AllowDockLeft   = !isAnchorPane && CanDock(DockHelper.GetViewModel <IDockPane>(targetElement), DockPosition.Left),
                AllowDockTop    = !isAnchorPane && CanDock(DockHelper.GetViewModel <IDockPane>(targetElement), DockPosition.Top),
                AllowDockRight  = !isAnchorPane && CanDock(DockHelper.GetViewModel <IDockPane>(targetElement), DockPosition.Right),
                AllowDockBottom = !isAnchorPane && CanDock(DockHelper.GetViewModel <IDockPane>(targetElement), DockPosition.Bottom),
                AllowDockInside = CanDock(DockHelper.GetViewModel <IDockPane>(targetElement), DockPosition.Inside),
            };
            _paneDockIndicators.Show();
        }
Beispiel #4
0
        private void ShowBorderDockIndicators()
        {
            Debug.Assert(_dockControl != null);

            if (_borderDockIndicators == null)
            {
                // The visible drop target buttons are determined by the DockStrategy.
                _borderDockIndicators = new BorderIndicators(_dockControl)
                {
                    AllowDockInside = false,
                    AllowDockLeft   = CanDock(null, DockPosition.Left),
                    AllowDockTop    = CanDock(null, DockPosition.Top),
                    AllowDockRight  = CanDock(null, DockPosition.Right),
                    AllowDockBottom = CanDock(null, DockPosition.Bottom),
                };
                _borderDockIndicators.Show();
            }

            // Bring border DockIndicators to front, otherwise they might be behind the
            // previews (semi-transparent rectangles) of the pane DockIndicators.
            var hWnd = new WindowInteropHelper(_borderDockIndicators).Handle;

            Win32.SetWindowPos(hWnd, IntPtr.Zero, 0, 0, 0, 0, SetWindowPosFlags.SWP_NOMOVE | SetWindowPosFlags.SWP_NOSIZE | SetWindowPosFlags.SWP_SHOWWINDOW | SetWindowPosFlags.SWP_NOACTIVATE);

            // Alternative:
            //_borderDockIndicators.Topmost = true;
            //_borderDockIndicators.Topmost = false;
        }
 private void HidePaneIndicators()
 {
     if (_paneDockIndicators != null)
     {
         _paneDockIndicators.Close();
         _paneDockIndicators = null;
     }
 }
 private void HideBorderDockIndicators()
 {
     if (_borderDockIndicators != null)
     {
         _borderDockIndicators.Close();
         _borderDockIndicators = null;
     }
 }
Beispiel #7
0
 private void HidePaneIndicators()
 {
     if (_paneDockIndicators != null)
     {
         _paneDockIndicators.Close();
         _paneDockIndicators = null;
     }
 }
Beispiel #8
0
 private void HideBorderDockIndicators()
 {
     if (_borderDockIndicators != null)
     {
         _borderDockIndicators.Close();
         _borderDockIndicators = null;
     }
 }
        protected override void OnLostMouseCapture(MouseEventArgs eventArgs)
        {
            base.OnLostMouseCapture(eventArgs);

            if (_borderIndicators != null)
            {
                _borderIndicators.Close();
                _borderIndicators = null;
            }

            if (_paneIndicators != null)
            {
                _paneIndicators.Close();
                _paneIndicators = null;
            }
        }
        private void ShowPaneIndicators(FrameworkElement targetElement)
        {
            Debug.Assert(targetElement != null);

            if (_paneDockIndicators != null && _paneDockIndicators.Target == targetElement)
                return;

            HidePaneIndicators();

            // The visible drop target buttons are determined by the DockStrategy.
            // For DockAnchorPanes only the inside button is visible.
            bool isAnchorPane = targetElement is DockAnchorPane;

            _paneDockIndicators = new PaneIndicators(targetElement)
            {
                AllowDockLeft = !isAnchorPane && CanDock(DockHelper.GetViewModel<IDockPane>(targetElement), DockPosition.Left),
                AllowDockTop = !isAnchorPane && CanDock(DockHelper.GetViewModel<IDockPane>(targetElement), DockPosition.Top),
                AllowDockRight = !isAnchorPane && CanDock(DockHelper.GetViewModel<IDockPane>(targetElement), DockPosition.Right),
                AllowDockBottom = !isAnchorPane && CanDock(DockHelper.GetViewModel<IDockPane>(targetElement), DockPosition.Bottom),
                AllowDockInside = CanDock(DockHelper.GetViewModel<IDockPane>(targetElement), DockPosition.Inside),
            };
            _paneDockIndicators.Show();
        }
 private static bool HasResult(DockIndicatorOverlay dockIndicators)
 {
     return dockIndicators != null && dockIndicators.Result != DockPosition.None;
 }
Beispiel #12
0
 private static bool HasResult(DockIndicatorOverlay dockIndicators)
 {
     return(dockIndicators != null && dockIndicators.Result != DockPosition.None);
 }