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 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; }