예제 #1
0
        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;
                    }
                }
            }
        }
예제 #2
0
파일: Connector.cs 프로젝트: 569550384/Rafy
        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;
                    }
                }
            }
        }