Cancel Delete in SelectionDeleting Event

Sorry if this has been answered already - I cannot find it.

In the diagram's SelectionDeleting event I am prompting the user if they are sure they want to delete the selected item (node or link).
I present them an asynchronous window - if they click NO the callback method runs this code and it works fine:
Dim mgr As UndoManager = myDiagram.Model.UndoManager
The problem is if I want to programmatically cancel the delete in the SelectionDeleting event. In some cases, nodes and links shoudn't be deleted at all. I want to undo it (like above) and just prompt the user with a warning msg saying the node, for example, cannot be deleted. In these cases there is no async window because I am not asking them to confirm.
In other words, why can't I cancel a delete in the SelectionDeleting event?

You can cancel a delete command in the Diagram.SelectionDeleting event. But if you do so, it wouldn’t make sense to then Undo() afterwards. That would just undo the delete – causing the parts to appear again!

Or perhaps I’m not understanding your situation correctly.

I guess I need to know to cancel the delete command. :)


[QUOTE=tivowatcher]I guess I need to know to cancel the delete command. :)

Nevermind - I got it. :)