rodriwasabi / gong-wpf-dragdrop

Automatically exported from code.google.com/p/gong-wpf-dragdrop
0 stars 1 forks source link

Problem with drag n drop when ContextMenu is open #22

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Create a ListView (set IsDropTarget=True, IsDragSource=True, 
DropHandler={Binding}
2. Set a ContextMenu on the ListView
3. Open the ContextMenu by rightclicking on an item
4. Select another item while the ContextMenu is open

What is the expected output? What do you see instead?
I expect the just clicked item to get selected without doing anything.
Instead the Framework thinks that I want to drag the item on which the 
ContextMenu was opened and therefor calls the Drop-Handler.

What version of the product are you using? On what operating system?
Windows 7, newest Version (just updated)

Please provide any additional information below.
Please check this and my other two issues. Thank you.

Original issue reported on code.google.com by jdan.iva...@chello.at on 18 Jun 2010 at 7:06

GoogleCodeExporter commented 8 years ago
The problem is with MouseEventArgs.GetPosition being relative coordinates. To 
fix, calculate the position relative to the event sender:

e.GetPosition(sender as IInputElement);

Change this in both DragInfo..ctor and DragDrop.PreviewMouseMove.

Original comment by DWick...@gmail.com on 26 Aug 2010 at 9:18