- The second argument,
obj, will be the object on which the event handler is defined. In this case it will be the button, a Panel.
obj.part will be the “ContextMenu”, an Adornment.
obj.part.adornedPart will be the Node.
- You could perform the deletion by
node.diagram.commit(d => d.remove(node)).
Although that won’t raise the appropriate DiagramEvents, if you depend on them.