-
-
Notifications
You must be signed in to change notification settings - Fork 389
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ListBox drag and drop - touch screen #110
Comments
@psoma i would do this, but i can't test this in the real world, cause i don't have any touchable device :-( |
There's also the question of how one wants to begin the drag operation,
|
What kind of touch screen are you using ? I'm using this library with a resistive touch-screen and i don't have any issues. |
It's created by using DoDragDrop(). The touchscreen was on our test machine, I think a Lenovo Yoga 2 tablet. |
Having same issue on all touch screens. Testing with Surface Pro 2, 3, and 4. |
I had a similar issue and in the end settled on it being a conflict between the native inertial scrolling in listbox and derived controls. It makes sense in that it's quite hard to tell the difference between a "press and move, meaning scroll the window" and a "press and move. meaning pick up that item for a drag" You could try disabling PanningMode, that may help? |
Adding |
No problem, glad it helped you out :D |
Problem is, setting the PanningMode is barely a work-around, and having a touch enabled application where you can't scroll a list with touch is a no go. Any udpate on this ? @punker76 |
I don't know if this helps, or if there are obvious holes in this I haven't realized yet, but a work-around that seems to be working for me is:
Pseudo-y code:
With this code, you can drag the view around as much as you want, but if you want to drag an item, tap it once to select it, and then you have a brief interval within which to start a drag operation. Let it sit, and it reverts to scrolly behaviour. I haven't investigated whether this would be easy to integrate directly into GongSolutions.Wpf.DragDrop, but maybe someone might find it useful (or be able to tell me why I shouldn't be doing it! :-D). |
Tap-release-hold-drag is a fairly common gesture to indicate that you want to do a drag rather than a scroll. |
I'm also interested in this feature, would be great to have it! |
I tried this but this part An object reference is required for non static field 'ScrollViewer.PanningMode' |
Use |
Oops, yes, sorry about that, 'twas a typo. 😳 |
I changed the code a little. Instead of changing the PanningMode on the SelectionChanged event, I have it on PreviewTouchDown, this way the drag is instant rather than having to select the item and then drag it.
|
But then you're not doing the double-tap-and-drag gesture any more, are you? |
Indeed, how do you scroll the item's container? With that change, why even have different panning modes? You could just leave it permanently set to |
Yes, you are right. When I tested initially there were only a couple items in the box :( I just want a smooth drag without the double tap. Maybe a hold and drag would do. |
I cant use drag and drop functionality on touch screens with ListBox/ListView.
Is it planned in the future or has anyone a workaround for it?
The text was updated successfully, but these errors were encountered: