/// <summary> /// Handles mousemove event. /// </summary> /// <param name="sender">Ignored.</param> /// <param name="e">Mouse event arguments.</param> private void OnMouseMove(object sender, MouseEventArgs e) { if (IsMouseCaptured) { Point point = ConvertRelativePointToScreenInDefaultDpi(this, e.GetPosition(this)); DragPaneServices.MoveDrag(point); } }
/////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////////////////////////// /// <summary> /// Create dock manager. /// </summary> public DockManager() { InitializeComponent(); DragPaneServices.Register(this); _overlayWindow = new OverlayWindow(this); }
/// <summary> /// Remove a dockable pane from layout management. /// </summary> /// <param name="pane">Pane to remove.</param> public void Remove(DockablePane pane) { if (pane.IsDragSupported) { DragPaneServices.Unregister(pane); } gridDocking.Remove(pane); }
/// <summary> /// Begins dragging operations. /// </summary> /// <param name="floatingWindow">Floating window containing pane which is dragged by user.</param> /// <param name="point">Current mouse position.</param> /// <param name="offset">Offset to be use to set floating window screen position.</param> /// <returns>Retruns True is drag is completed, false otherwise.</returns> public bool Drag(FloatingWindow floatingWindow, Point point, Point offset) { if (IsMouseCaptured) { return(false); } if (!CaptureMouse()) { return(false); } DragPaneServices.StartDrag(floatingWindow, point, offset); return(true); }