c# - WPF TreeView Drag and Drop - Drop event always fires when clicking element -


i'm trying put drag & drop solution in wpf treeview control, using these techniques: dragging , dropping treeview, finding index insert dropped item

when user clicks on treeviewitem, first treeviewitem_mouseleftbuttondown gets executed, treeviewitem_drop also. @ every single click.

it sounds you're calling dragdrop.dodragdrop() treeviewitem_mouseleftbutton handler. treeviewitem_drop raised when mouse button released, you're getting drop event on every mouse click. try calling dodragdrop treeviewitem_mousemove handler instead. make sure left mouse button pressed before calling drodragdrop. may want make sure mouse has moved minimum distance before starting dragdrop operation well, such as

if(e.leftbutton == mousebuttonstate.pressed      && horizontal_move > systemparameters.minimumhorizontaldragdistance) {     dragdrop.dodragdrop(); } 

Comments

Popular posts from this blog

c# - Operator '==' incompatible with operand types 'Guid' and 'Guid' using DynamicExpression.ParseLambda<T, bool> -