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

feat(Gestures): Allow using some Gestures events in Xaml #13232

Conversation

workgroupengineering
Copy link
Contributor

@workgroupengineering workgroupengineering commented Oct 12, 2023

What does the pull request do?

Allow using some Gestures events in Xaml

What is the current behavior?

If using Gesture in Xaml compiler throw AVLN: 0004: XamlX.XamlParseException: Unable to resolve suitable regular or attached property Pinch

<Window xmlns="https://github.com/avaloniaui"
     xmlns:x='http://schemas.microsoft.com/winfx/2006/xaml'
     x:Class="Sandbox.MainWindow"
     Gestures.Pinch="Pinch">
    <Window.GestureRecognizers>
     <PinchGestureRecognizer/>
  </Window.GestureRecognizers>
</Window>

What is the updated/expected behavior with this PR?

Compile

How was the solution implemented (if it's not obvious)?

XamlC to identify that it is an attached event, looks for the presence of a method named Add<EventName>Handler example for the PinchEvent event AddPinchHandler

Checklist

Breaking changes

Obsoletions / Deprecations

Fixed issues

Fixes #13231

@workgroupengineering
Copy link
Contributor Author

workgroupengineering commented Oct 12, 2023

There are some event names that I think should be changed.
Example :
Gestures.PullGestureEvent will become Gestures.PullEvent

I will open an issue with the proposed changes.

Here there is a proposal of events rename.

@avaloniaui-team
Copy link
Contributor

You can test this PR using the following package version. 11.0.999-cibuild0040790-beta. (feed url: https://nuget-feed-all.avaloniaui.net/v3/index.json) [PRBUILDID]

@maxkatz6 maxkatz6 added this pull request to the merge queue Oct 17, 2023
Merged via the queue into AvaloniaUI:master with commit ea64024 Oct 17, 2023
6 checks passed
@workgroupengineering workgroupengineering deleted the features/Core/Gestures/Add-Some-Event-Handlers branch October 18, 2023 03:23
@maxkatz6 maxkatz6 added the backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch label Nov 5, 2023
maxkatz6 pushed a commit that referenced this pull request Dec 5, 2023
* feat(Gestures): Adds HoldingEvent handlers

* feat(Gestures): Adds PinchEvent handlers

* feat(Gestures): Adds PinchEndedEvent handlers

* feat(Gestures): Adds PullGestureEvent handlers

* feat(Gestures): Adds PullGestureEndedEvent handlers

* feat(Gestures): Adds PointerTouchPadGestureMagnifyEvent handlers

* feat(Gestures): Adds PointerTouchPadGestureRotateEvent handlers

* feat(Gestures): Adds PointerTouchPadGestureSwipeEvent handlers

* feat(Gestures): Adds ScrollGestureEvent handlers

* feat(Gestures): Adds ScrollGestureEndedEvent handlers

* feat(Gestures): Adds ScrollGestureInertiaStartingEvent handlers
@maxkatz6 maxkatz6 added backported-11.0.x and removed backport-candidate-11.0.x Consider this PR for backporting to 11.0 branch labels Dec 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cannot use Gesture.Pinch, Gesture.PinchEnd, Gesture.Pull in Xaml
3 participants