Drag and drop #26
-
Hello community, New to the Fabulous app development is there documentation on how to implement drag and drop functionality? Any help would be appreciated. Thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 0 comments 1 reply
-
Hi @mikegladden In a general way, you can find the documentation of Fabulous here: https://fsprojects.github.io/Fabulous/Fabulous.XamarinForms/ Porting the C#/XAML samples of the Xamarin.Forms documentation to Fabulous should be relatively straightforward. Regarding your question about Drag & Drop, here's the Xamarin.Forms documentation for it: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/gestures/drag-and-drop Based on that page, we can write the following code in Fabulous: View.StackLayout([
View.Image(
source = Image.fromPath "image.png",
gestureRecognizers = [
View.DragGestureRecognizer(canDrag = true)
]
)
View.Image(
gestureRecognizers = [
View.DropGestureRecognizer(allowDrop = true)
// Or in case you need to do some processing on the DataPackage
// View.DropGestureRecognizer(
// allowDrop = true,
// drop = fun e -> dispatch (DropMsg e)
// )
// Same applies to DragGestureRecognizer
]
)
]) |
Beta Was this translation helpful? Give feedback.
Hi @mikegladden
In a general way, you can find the documentation of Fabulous here: https://fsprojects.github.io/Fabulous/Fabulous.XamarinForms/
For documentation on the usage of specific features coming from Xamarin.Forms, I recommend you take a look at the Xamarin.Forms documentation also: https://docs.microsoft.com/en-us/xamarin/xamarin-forms
Porting the C#/XAML samples of the Xamarin.Forms documentation to Fabulous should be relatively straightforward.
Regarding your question about Drag & Drop, here's the Xamarin.Forms documentation for it: https://docs.microsoft.com/en-us/xamarin/xamarin-forms/app-fundamentals/gestures/drag-and-drop
Based on that page, we can write the following code …