Beispiel #1
0
        protected virtual void OnHeaderMouseMove(object sender, MouseEventArgs e)
        {
            //Point ptMouseMove = e.GetPosition(this);
            Point ptMouseMove = e.GetPosition((IInputElement)System.Windows.Media.VisualTreeHelper.GetParent(this));


            if (!e.Handled && isMouseDown && e.LeftButton == MouseButtonState.Pressed)
            {
                if (_partHeader != null &&
                    _partHeader.IsMouseOver)
                {
                    DockingManager manager = GetManager();
                    if (!manager.DragPaneServices.IsDragging &&
                        !IsMouseCaptured)
                    {
                        if (Math.Abs(ptMouseMove.X - ptStartDrag.X) > SystemParameters.MinimumHorizontalDragDistance ||
                            Math.Abs(ptMouseMove.Y - ptStartDrag.Y) > SystemParameters.MinimumVerticalDragDistance)
                        {
                            isMouseDown = false;
                            ReleaseMouseCapture();

                            manager.Drag(this, this.PointToScreenDPI(e.GetPosition(this)), e.GetPosition(this));
                            e.Handled = true;
                        }
                    }
                }
            }
        }