DropOntoBehavior on Links

Hi Walter, I’m building a diagram very similar to the new Flowgrammer sample. The example is very helpful, but I still have an open issue:

Given how narrow links usually are, is there anyway i could make the “drop zone” much bigger? maybe by adding a transparent rectangle to the link’s template?

You have the right idea, but using a rectangle has problems when links are close enough to cause the rectangles to overlap or when their paths are long and sinuous. Instead, use a thicker path that is transparent.

The Draggable Link sample demonstrates this in the link DataTemplate:
<go:LinkPanel . . .>
<go:LinkShape Stroke=“Transparent” StrokeThickness=“5” />
<go:LinkShape x:Name=“Path” Stroke=“Black” StrokeThickness=“1” />
. . . arrowhead and/or labels . . .

I should say that the ability to have multiple link shapes in a LinkPanel sharing the same path route is new for version 1.2.

The Piping sample also demonstrates the use of this new feature, but to use multiple colors creating a primitive gradient across the thickness of the “pipe”.

Thanks. Actually I’ve just found it myself in the samples of version 1.2, and it’s working . However, I’m still having some trouble with the drop behavior since I’m using a very thick stroke:
<go:LinkShape Stroke=“Transparent” StrokeThickness=“100” />

My problem is that the links to the dragged node are sometimes on top of the existing links that want to drop them onto, and by that preventing from dropping on the desired links.
1. Is there any way not to drag the node's links during the drag? I don't need them to move while dragging
2. Is there a way to put the current node's links "behind" all the other links?

Using such a thickness is probably a bad idea, unless your visible LinkShape had a StrokeThickness that was close to 100.

Imagine taking it to the extreme: StrokeThickness=“9999999”. Whichever Link that was “frontmost” would capture all of the mouse events for the whole diagram, regardless of what the user would see of the non-Transparent LinkShapes.

I suspect that not updating the routes of links connected to the selection isn’t so easy, but I haven’t tried it.

I suppose you could change the Part.LayerName of connected Links. But I would first encourage you to reduce the size of completely transparent elements that consume mouse events.

Thanks, I’ll give it a try.

I understand such a thickness it is not the best idea, but I think it's a common scenario in order to let the user to easily drop a node on a link, by not having to be very accurate with the mouse cursor.

A post was split to a new topic: Drop onto link