public void ForceDocking(DockPane targetDockPane, FloatingWindow floatingWindow, EDock dock) { try { DockPane dockPane = floatingWindow.MainDockPane; dockPane.RemoveSelf(); if (dockPane != null) { targetDockPane.Docking(dockPane, dock); floatingWindow.Close(); } } catch { return; } }
public void Docking(FloatingWindow floatingWindow, Point point) { if (CurrentDockPane != null) { OverlayWindow overlay = CurrentDockPane.OverlayWindow; DockPane dockPane = floatingWindow.MainDockPane; dockPane.RemoveSelf(); GridSplitter splitter = new GridSplitter(); splitter.Background = Brushes.Gray; if (dockPane != null) { if (overlay.LeftDock.Contains(point)) { CurrentDockPane.Docking(dockPane, EDock.Left); } else if (overlay.RightDock.Contains(point)) { CurrentDockPane.Docking(dockPane, EDock.Right); } else if (overlay.TopDock.Contains(point)) { CurrentDockPane.Docking(dockPane, EDock.Top); } else if (overlay.BottomDock.Contains(point)) { CurrentDockPane.Docking(dockPane, EDock.Bottom); } else if (overlay.CenterDock.Contains(point)) { CurrentDockPane.Docking(dockPane, EDock.Center); } floatingWindow.Close(); } } }
public void UnDocking(ContentPane contentPane) { DockPane dockPane = contentPane.ParentDockPane; dockPane.Background = Brushes.Black; dockPane.RemoveContentPane(contentPane); Point point = PointToScreen(System.Windows.Input.Mouse.GetPosition(this)); FloatingWindow floatingWindow = new FloatingWindow { MainContent = contentPane, Left = point.X, Top = point.Y }; floatingWindow.Show(); floatingWindow.Activate(); //Arrange Grid ArrangeDockPane(dockPane); ArrangeGrid(dockPane.ParentDockPane); }
public void ShowOverlay(FloatingWindow floatingWindow, Point point) { foreach (DockPane dockPane in DockedPanes) { Rect rect = dockPane.DockingArea; if (rect.Contains(point)) { //if (CurrentDockPane != null) //{ // int z1 = GetZIndex(dockPane); // int z2 = GetZIndex(CurrentDockPane); // if (z1 > z2) // { // CurrentDockPane.InactivationOverlay(); // CurrentDockPane = dockPane; // dockPane.ActivationOverlay(); // } // else // { // CurrentDockPane.ActivationOverlay(); // } //} //else { CurrentDockPane = dockPane; dockPane.ActivationOverlay(); } } else { dockPane.InactivationOverlay(); } } }