haithambradai / gong-wpf-dragdrop

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

Selecting an item and the mouse quickly changes selection before drag is started #1

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
When clicking an item and moving the mouse quickly, rather than a drag on the 
item that was clicked on being dragged, sometimes the selection changes 
before the drag is started. This is particularly noticeable if clicking the 
item causes the UI to lock up for a short time.

Original issue reported on code.google.com by gro...@gmail.com on 7 Nov 2009 at 7:14

GoogleCodeExporter commented 9 years ago
We need to set e.Handled to prevent propagation of all MouseDown events until 
we can 
determine whether a drag is initiated. Once we determine that no drag was 
initiated 
then we need to pass the click to the control.

Original comment by gro...@gmail.com on 7 Nov 2009 at 7:16

GoogleCodeExporter commented 9 years ago
This can be fixed by disabling the automatic selection behavior for ListBox 
(where holding left mouse and dragging changes the selection).

ListBox does not let you disable this out of the box, so it's a bit of a hack:
http://stackoverflow.com/questions/5667998/prevent-wpf-listbox-from-selecting-it
em-under-mouse-when-layout-changes

Original comment by DWick...@gmail.com on 2 Mar 2012 at 10:28