コード例 #1
0
 /// <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);
     }
 }
コード例 #2
0
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////
        ///////////////////////////////////////////////////////////////////////////////////////////

        /// <summary>
        /// Create dock manager.
        /// </summary>
        public DockManager()
        {
            InitializeComponent();

            DragPaneServices.Register(this);

            _overlayWindow = new OverlayWindow(this);
        }
コード例 #3
0
        /// <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);
        }
コード例 #4
0
        /// <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);
        }