I need a virtual method to tell a target that the current DragAndDrop operation is cancelled.
The itemDragExit method is not sufficient because an item can leave the target (itemDragExit) and then can enter the same target again and so on. I cannot rely on itemDragExit event because it can happen several times before completion. I need the only one event on cancelation. I need a way to register DragAndDropTarget instances that want to receive cancellation event from DragAndDropContainer class instance.
The problem is I hide a component that is currently being dragged and rearrange neighbour components to make a room for the item while the ‘drag and drop’ operation is active. So, if the operation is cancelled (an item is dropped outside the target and none component is interested in it) then the hidden item stays invisible and that’s not what I need. If I’d know that the operation is cancelled I might roll everything back to its original state.
What do you say?