Link.DragOverSnapEnabled is it available?

hi walter



i wanna use Link.DragOverSnapEnabled…

but it doesn’t work…



node is only bellow setting … it works

------------------------------------

myDiagram.GridVisible = true

myDiagram.GridSnapEnabled = true

------------------------------------



so i used custom myPartManager



protected override void OnLinkAdded(Link link)

{

link.DragOverSnapEnabled = true;

}



myDiagram.PartManager = new myPartManager();



but it doesn’t work



Any solutions?

I think DraggingTool doesn’t support drag-snapping over Links – just over Nodes. I believe the idea was that hardly anyone would find snapping over links to be useful, given how narrow links usually are.

And that’s only if you have turned on DraggingTool.DragOverSnapArea=“DiagramAndNodes” (or just “Nodes” if you don’t care about snapping over the diagram’s background).

By the way, you didn’t need to override a PartManager method in order to set Part.DragOverSnapEnabled – one normally does it by setting that attached property on the root element of the DataTemplate.

And if you did override PartManager.OnLinkAdded, you probably need to call the base method as well!

Oh, and in case it isn’t clear – just because DraggingTool doesn’t support drag-snapping over Links, doesn’t mean DraggingTool doesn’t support dropping onto Links.

The value DropOntoBehavior.SplicesIntoLink is an example of that. A new sample in version 1.2, Flowgrammer, demonstrates this feature.

And if that wasn’t the drop-onto-Link behavior you wanted, you can implement what you want by overriding DraggingTool.ConsiderDragOver, DragOver, and DropOnto.