/// <summary> /// if dragger: sets resolved = true if the mouse is outside of the dragging rectangle /// if doubleclick: sets resolved = true if the mouse is outside of the dragging rectangle /// </summary> /// <param name="sender"></param> /// <param name="e"></param> protected virtual void BaseMouseMove(MouseActionEventArgs e) { if (Behaviour == DragBehaviour.Dragger) { if (!Resolved) { if (((e.Button & MouseActionButtons.Left) == MouseActionButtons.Left)) { // If the mouse moves outside the Rectangle, start the drag Resolved = (DragBoxFromMouseDown != Rectangle.Zero && !DragBoxFromMouseDown.Contains(e.X, e.Y)); } } else { Resolved = ((e.Button & MouseActionButtons.Left) == MouseActionButtons.Left); } } else if (Behaviour == DragBehaviour.DoubleClick) { Resolved = Resolved && CheckDoubleClickHit(e.X, e.Y); } }
protected virtual bool CheckDoubleClickHit(double x, double y) { return(DragBoxFromMouseDown.Contains(x, y)); }