Reputation: 18386
How do we add drag & drop functionality in Xamarin..
After lot of googling I found the following official link for drag & drop for xamarin..
https://blog.xamarin.com/android-tricks-supporting-drag-and-drop-in-an-app/
But it uses the android native code only.
My questions:
In Xamarin is it possible to implement drag & drop functionality without native codes?
If answer - No -> How do we achieve the drag & drop listeners for all platforms?
I searched google & the official forum and nothing found.. Someone help me..Thanks..
Upvotes: 14
Views: 8026
Reputation: 2382
2020 it looks like we have it. You still need to set up DragAndDrop_Experimental flag.
https://learn.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/gestures/drag-and-drop
Upvotes: 1
Reputation: 601
Please check the below links,may it helps you.
https://developer.xamarin.com/recipes/ios/input/touch/drag_rotate_image/
http://forums.xamarin.com/discussion/6521/how-to-perform-drag-and-drop-functionality
https://pumpingco.de/blog/adding-drag-and-drop-to-your-android-application-with-xamarin/
Upvotes: 5
Reputation: 1453
Xamarin.Forms does not appear to support that kind of touch. Event handlers for on touch would have to be written in the native implementations with a dependency injection pattern for accessing them from the shared code.
The only built in gestures recognized are tap, pinch and pan.
Using the below link it should not be too difficult to get drag and drop up and running.
https://developer.xamarin.com/guides/cross-platform/application_fundamentals/touch/
https://developer.xamarin.com/guides/xamarin-forms/dependency-service/introduction/
Upvotes: 1