Catch DropOntoBehavior Event

Hello, I’m Antonio from México and i’m working whit goXam for silverlight
I have in my diagram code:

go:Part.DropOntoBehavior="AddsLinkFromNode"
Is there a way of capture this in an event? Thank you.

There are three Diagram events that might be raised, depending on why the drop occurred: Diagram.ExternalObjectsDropped, SelectionMoved, and SelectionCopied.

Thank you, i’ve used SelectionMoved event, but now i want to validate if the movement is valid and if it’s not i need to undo the movement, i’ve tried e.handled = True but it doesn’t works.
Is there a way?

None of the diagram events ending in “ed” are cancellable – only those ending in “ing” are. So it’s too late to try to prevent it from happening.

Besides, wouldn’t it be better to disallow the user from dropping there and making all of those changes? It’s always better to keep the user from doing something bad than it is to let them do it and try to clean up afterwards.

You’ll want to replace the standard Diagram.DraggingTool by overriding DraggingTool.ConsiderDragOver or DraggingTool.IsValidLink, depending on what you want to consider to decide whether a drop of a selected node onto a stationary node would be OK.

Yes you were right, I did it overwriting the isValidLink method and it works perfect.
Thank you very much!