Example #1
0
 private void BeginDrag(MouseButtonEventArgs e, DragEndPoint endPoint)
 {
     if (null == root) return;
     if (MouseButton.Left != e.ChangedButton) return;
     CaptureMouse();
     dragType = endPoint;
     dragInit = (Point)(e.GetPosition(root) - (dragType == DragEndPoint.Input ? StartPoint : StopPoint));
     e.Handled = true;
 }
Example #2
0
 protected override void OnMouseUp(MouseButtonEventArgs e)
 {
     base.OnMouseUp(e);
     var type = dragType;
     dragType = DragEndPoint.Unknown;
     ReleaseMouseCapture();
     if (null != snappedSocket)
     {
         if (DragEndPoint.Input == type)
             ConnectInputEndPoint(snappedSocket);
         else
             ConnectOutputEndPoint(snappedSocket);
     }
     if (null == inputSocket || null == outputSocket)
         Delete();
     snappedSocket = null;
     e.Handled = true;
 }