[Enhancement] Use gesture events instead of GestureRecognizers #107
Unanswered
MichaelRumpler
asked this question in
General
Replies: 1 comment 3 replies
-
We haven't had a chance to dissect how exactly we're going to manifest gestures but we will most likely keep the GestureRecognizers for compatibility reasons.
Thank you for this!!! Once we get to gestures we'll start evaluating all of this closer |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Summary
When Xamarin.Forms was made, the developers had only iOS and Android on their minds. They also copied parts of those APIs which used GestureRecognizers / detectors. Objective-C and Java don't have events, so the architects of those APIs had to think of something else. But C# had events from the very start and these are much easier for being notified when something happens. Events have been used by .NET in every framework MS wrote.
API Changes
Remove
X.F.View.GestureRecognizers
and add events and commands instead which handle all the gestures.In MR.Gestures I currently have
Down
,Up
,Tapping
,Tapped
,DoubleTapped
,LongPressing
,LongPressed
,Panning
,Panned
,Swiped
,Pinching
,Pinched
,Rotating
andRotated
. As you are advertising MAUI to be for desktop development (and mobile OSes also get better support for bluetooth mice),PointerEntered
,PointerMoved
andPointerExited
also make sense.When I made MR.Gestures I didn't think about nested gesture handling controls enough. I should've also added Preview- events. As I didn't have them, handling nested controls was always a PITA. If you also add those Preview- events and provide a method to handle the gesture in either the preview or the normal event, lives of your users would be easier.
I'm also willing to contribute my code of MR.Gestures. I didn't look at your gesture recognizers for a long time, but as people still buy MR.Gestures, it must still be better.
Links
There are plenty of examples how MR.Gestures work on
This would be the same in MAUI.
Beta Was this translation helpful? Give feedback.
All reactions