Пример #1
0
        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;
            }
        }
Пример #2
0
        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();
                }
            }
        }