Skip to content
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

Add Remove option to GestureRecognizerCollection #12558

Open
edgarfgp opened this issue Aug 16, 2023 · 5 comments
Open

Add Remove option to GestureRecognizerCollection #12558

edgarfgp opened this issue Aug 16, 2023 · 5 comments

Comments

@edgarfgp
Copy link

Is your feature request related to a problem? Please describe.
While working on Fabulous.Avalonia gesture recognizers, I found that GestureRecognizerCollection uses IReadOnlyCollection<GestureRecognizer> and only exposes Add.

Describe the solution you'd like

  • Update GestureRecognizerCollection to inherit from.AvaloniaList< GestureRecognizer>
  • Or keep IReadOnlyCollection<GestureRecognizer> and expose a Remove method that will modify the private List<GestureRecognizer>? _recognizers

Describe alternatives you've considered

@timunie
Copy link
Contributor

timunie commented Aug 16, 2023

@emmauss adding an option to remove a gesture sounds like a valid thing to do to me. What do you think, could we accept a PR introducing this API?

If yes, @edgarfgp a PR would be welcome.

@edgarfgp
Copy link
Author

@timunie I would be happy to contribute so I can complete the support of Avalonia in F# Fabulous

@timunie
Copy link
Contributor

timunie commented Aug 24, 2023

I've been talking to the team. In general we would accept a method Remove added to remove a GestureRecognizer. However, we need to make sure the gesture can be removed. If it's currently in use while removing, this would break things. So if you start working on this, keep in mind that you have to check if the Gesture is able to remove first.

Good luck 👍

@edgarfgp
Copy link
Author

edgarfgp commented Sep 6, 2023

@timunie I was wondering if there are any issues with the gestures currently. Looking at https://github.com/AvaloniaUI/Avalonia/blob/master/samples/ControlCatalog/Pages/GesturePage.cs I could not trigger any gesture. Thanks in advance :)

@emmauss
Copy link
Contributor

emmauss commented Sep 6, 2023

@timunie I was wondering if there are any issues with the gestures currently. Looking at https://github.com/AvaloniaUI/Avalonia/blob/master/samples/ControlCatalog/Pages/GesturePage.cs I could not trigger any gesture. Thanks in advance :)

Some gestures require touch input.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants