.netwpfdrag-and-droponmouseup

Drag&Drop prevent preview mouse up


I want to show context menu on ListView element when Drag&Drop operation finishes by dropping some data on it. The proplem is that it seems Drag&Drop to prevent PreviewMouseUp event firing somehow. Is there some workarounds to show ContextMenu on drop?


Solution

  • This is entirely expected, the mouse events are re-routed to the drag+drop logic. They now generate the D+D events instead. Roughly, MouseEnter now generates DragEnter, MouseMove fires DragOver, MouseUp triggers Drop.

    The logical workaround is to show the ContextMenu in your Drop event handler.