c# - WPF drag distance threshold -


i have program 2 wpf treeviews allow dragging , dropping between two. problem is, can annoying open / close items on treeviews because moving mouse 1 pixel while holding left mouse button triggers drag / drop functionality. there way specify how far mouse should move before it's considered drag / drop?

there's system parameter this. if have

point down = {where mouse down event happened} point current = {position in mousemove eventargs} 

then mouse has moved minimum drag distance if

math.abs(current.x - down.x) >= systemparameters.minimumhorizontaldragdistance || math.abs(current.y - down.y) >= systemparameters.minimumverticaldragdistance) 

Comments

Popular posts from this blog

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

c# - Making TableLayoutPanel Act Like An HTML Table (Cells That Resize Automatically Around Text) -