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
mgr.Undo()
mgr.CompoundEdits.Remove(mgr.EditToRedo)
mgr.Undo()
mgr.CompoundEdits.Remove(mgr.EditToRedo)
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?
Thanks-
Dave