-
Notifications
You must be signed in to change notification settings - Fork 1.9k
[Spec] DragGestureRecognizer DropGestureRecognizer #10778
Comments
What about additional commands to the events? I really like the specs, just would like to have commands as well as events. |
https://github.com/xamarin/Xamarin.Forms/pull/11537/files#diff-eaca5f8f9dd0e23a11bddbe989c5badaR15 I added commands for all the events Thank you for the reminder 👍 |
Thanks for useful things. |
Does this support ColletionView ? I saw that first implementations won't have tight integrations with collectionView.. Anyways it was a much needed one and thanks for doing it. |
Just tried. Works great. |
Works for any view and for items in CollectionView too. But these are simple gestures, they don't know anything about collections. So, scrolling and another interactivity cannot work if you move views in collections. |
Yea, I've gone around in my head a few times about the naming here. The current naming is basically just a copy paste from the UWP APIs but I'm also not convinced on the current names. One of my thoughts was to just change them both to "Enabled" since our implementation here split these out to separate recognizers.
I've had this thought as well :-) There's a lot of stuff you have to enable at the platform level to even make drag and drop work. For example you have to handle the drag/drop events and then opt in. I setup the implementation to just opt in by default because I'd rather people have to turn things off and just make it all work with minimal API. I feel like defaulting these to true would be a good idea.
Hey that's cool!! I haven't really tested it with CV I just know each native platform has very specific APIs for doing drag and drop with collections and I haven't wired into those yet. I was kind of figuring you could make it work as is but the intention is to have the final implementation tie into the native drag and drop apis related to collections Thank you for the feedback!!! I've created an issue here where we can track changes we'd like to make before releasing |
I have to say that DropGestureRecognizer works on DataTemplate level but not for whole CollectionView. OnDrop doesn't raise:
OnDrop does raise:
|
@IgorKravchenko10 yea all the platforms have different delegates and events very specific to lists you have to use to make this all work. So, I'll need to tie into those :-) |
DragGestureRecognizer
DropGestureRecognizer
API
VisualStates associated with target drop
DropGestureRecognizer
Properties
Events
DragGestureRecognizer
Properties
Events
DragState
DragItemsStartingEventArgs
Properties
DataPackageOperation
DragEventArgs
Properties
DropCompletedEventArgs
Properties
DropEventArgs
Properties
DataPackage
This is used to setup the data for transfer
DataPackageView
This is a read-only copy of the DataPackage object.
This is all the user gets on the drop event to retrieve the data. They can't modify the package
Examples
Basic Xaml Example
Workflow
DragOverStackLayout
the user doesn't do anything so the SL won't receive the element if the user drops it herreDragOver
fires and the user sets the accepted operation to something other thanNone
FiresWhenDropped
firesCollectionView considerations
First implementation won't have tight integration with CV
The text was updated successfully, but these errors were encountered: