Deletion Tool?

Hello,

When I connect two nodes using the mouse the LinkingTool manage the event.

Which is the tool that manage the event when I delete a node or a link using the “Del” button on my keyboard?

Thank you!

When the user is not doing anything with the mouse, the current tool is the default tool, the ToolManager. It just passes on all keyboard events to the CommandHandler.

What do you want to do? What platform are you using?

I would like to manage the Del button on keyboard when I delete a link in a GraphLinksModel

Deleting any Part will automatically modify (i.e. remove data from) the model.

Are you trying to prevent a Link from being deleted by the user? If so, just set its Deletable property to false.

Or are you trying to do other side-effects when a link data object is removed from the GraphLinksModel.LinksSource collection? If so, you could implement a DiagramModel.Changed event handler.

Yes, when I delete a link I want to delete also other nodes/links.

I’ve tried to use the Diagram.Model.Changed event, but when I try to modify the Model I get an exception:
“Cannot change ObservableCollection during a CollectionChanged event.”

I resolved it creating a custom CommandHandler and overriding the Delete method.

Thank you again for your time