WPF DragDrop.DoDragDrop (for RIGHT-Click?)

In WPF, I want to start a drag and drop with a right click. Something like Windows Explorer, right-click, move a little, and you get an advertiser to indicate a drop in drag and drop. Do not move, and you get a context menu when you release the button.

It all started for me, but when I call "DragDrop.DoDragDrop", it immediately drops directly, it did not wait for the mouse.

I looked at this link Stack Overflow Question and refers to the Silverlight article and the need for MouseCapture. And it only works with the left button. Taken literally, it would seem, it is simply impossible to perform a drag-and-drop operation with the right button (for example, windows) in wpf. I always have difficult times, believe such things :) (I tried MouseCapture to no avail)

+3
source share
1 answer

Found a solution to your problem on MSDN forums . The main idea is to use DragDrop.AddQueryContinueDragHandler .

0
source

Source: https://habr.com/ru/post/1780982/


All Articles