protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); // if mouse button is not pressed we have no drag operation, ... if (e.LeftButton != MouseButtonState.Pressed) { this._dragStartPoint = null; } // but if mouse button is pressed and start point value is set we do have one if (this._dragStartPoint.HasValue) { // create connection adorner var canvas = FindCanvas(); if (canvas != null) { var adornerLayer = AdornerLayer.GetAdornerLayer(canvas); if (adornerLayer != null) { var adorner = new ConnectorAdorner(canvas, this); adornerLayer.Add(adorner); e.Handled = true; } } } }
protected override void OnMouseMove(MouseEventArgs e) { base.OnMouseMove(e); // if mouse button is not pressed we have no drag operation, ... if (e.LeftButton != MouseButtonState.Pressed) this._dragStartPoint = null; // but if mouse button is pressed and start point value is set we do have one if (this._dragStartPoint.HasValue) { // create connection adorner var canvas = FindCanvas(); if (canvas != null) { var adornerLayer = AdornerLayer.GetAdornerLayer(canvas); if (adornerLayer != null) { var adorner = new ConnectorAdorner(canvas, this); adornerLayer.Add(adorner); e.Handled = true; } } } }