Draggable Label Node

Hello,

I could able to connect links to another link by defining a label node on the link. But the label node is always attached to the middle of the link.

I would like to have a draggable label node, which can be dragged along the link to which it is attached. How to achieve this?

Thanks in advance…!

Normally the general solution is to override DraggingTool.ComputeMove so that it returns only locations that you want to permit.

But that would not be satisfactory for label nodes. Instead I think you want to override DraggingTool.MoveParts. If not dragging a label node, just call the base method. (Caution: decide how to handle multiple selections.) If dragging a label node, you will want to instead set the attached properties LinkPanel.Index and LinkPanel.Fraction on the label node so that the LinkPanel arranges the node to be at the point closest to where the mouse is.

If your routing has straight segments, this is relatively easy to program.