Example #1
0
 void dragHandle_DragStarted(object sender, DragStartedEventArgs e)
 {
     for (int i = 0; i < linkStroke.path.Count && linkStrokeAnchor == linkStroke.path.Count; i++)
     {
         if ((sender as Thumb) == anchors[i])
         {
             linkStrokeAnchor = i;
         }
     }
     if (linkStrokeAnchor == 0 || linkStrokeAnchor == linkStroke.path.Count - 1)
     {
         canvas.addAnchorPoints();
         string formIdToUpdate = "";
         string formId         = "";
         if (linkStrokeAnchor == 0)
         {
             formIdToUpdate = linkStroke.from?.formId;
             formId         = linkStroke.to?.formId;
         }
         else
         {
             formIdToUpdate = linkStroke.to?.formId;
             formId         = linkStroke.from?.formId;
         }
         if (formIdToUpdate != null)
         {
             canvas.StrokesDictionary.TryGetValue(formIdToUpdate, out anchoredShapeStrokeToUpdate);
         }
         if (formId != null)
         {
             canvas.StrokesDictionary.TryGetValue(formId, out anchoredShapeStroke);
         }
     }
     canvas.isUpdatingLink = true;
 }
 void dragHandle_DragStarted(object sender,
                             DragStartedEventArgs e)
 {
     canvas.addAnchorPoints();
     linkPreviewGeom.StartPoint = Mouse.GetPosition(this);
 }