Skip to content

Corrected PointerPointProperties inline documentation, and exposed it on PointerEventArgs #19062

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

Merged

Conversation

TomEdwardsEnscape
Copy link
Contributor

I noticed some minor problems with PointerPointProperties while adding input handling code. This PR addresses them.

  1. The inline documentation of the various "IsXPressed" properties claimed that they indicated "whether the pointer input was triggered" by that button. This was wrong, as their values only indicate whether the relevant button was pressed at the time the event occurred. It's the PointerUpdateKind property which indicates which button press/release triggered the event.

  2. The only way to get a PointerPointProperties object for a pointer event was to call the GetCurrentPoint method. This frustrates pattern matching, which only works with properties. There is no reason to hide an event's pointer properties behind a method because they are immutable, so I changed the existing property which stores them from protected to public.

What is the updated/expected behavior with this PR?

No changes to behaviour.

Breaking changes

None

Obsoletions / Deprecations

None

Made PointerEventArgs.Properties public, to better support pattern matching
@TomEdwardsEnscape TomEdwardsEnscape force-pushed the fixes/PointerPointInlineDocumentation branch from f0cd246 to af6230d Compare June 16, 2025 18:55
@avaloniaui-bot
Copy link

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

@MrJul MrJul added enhancement backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch labels Jun 17, 2025
Copy link
Member

@MrJul MrJul left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you! It's always good to have clearer documentation.

@MrJul MrJul added this pull request to the merge queue Jun 17, 2025
Merged via the queue into AvaloniaUI:master with commit 43da5c6 Jun 17, 2025
11 checks passed
@TomEdwardsEnscape TomEdwardsEnscape deleted the fixes/PointerPointInlineDocumentation branch June 17, 2025 11:07
MrJul pushed a commit that referenced this pull request Jun 24, 2025
Made PointerEventArgs.Properties public, to better support pattern matching
@MrJul MrJul added backported-11.3.x and removed backport-candidate-11.3.x Consider this PR for backporting to 11.3 branch labels Jun 24, 2025
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.

3 participants