Skip to content

Add LongPressGestureRecognizer sample for .NET MAUI 11#752

Open
davidortinau wants to merge 3 commits intomainfrom
sample-longpress-gesture
Open

Add LongPressGestureRecognizer sample for .NET MAUI 11#752
davidortinau wants to merge 3 commits intomainfrom
sample-longpress-gesture

Conversation

@davidortinau
Copy link
Copy Markdown
Contributor

Summary

Standalone sample demonstrating the new LongPressGestureRecognizer in .NET MAUI 11 (dotnet/maui#33432).

APIs demonstrated

  • LongPressGestureRecognizer with Command and LongPressed event
  • MinimumPressDuration, AllowableMovement, NumberOfTouchesRequired
  • State tracking via LongPressing event and GestureStatus
  • Position detection via GetPosition()
  • Combining LongPress with TapGestureRecognizer

Files

  • 11.0/UserInterface/Gestures/LongPressGesture/ — complete standalone project
  • Includes docregion markers for snippet extraction
  • README with feature list and platform notes

Companion to docs-maui#3215 (LongPress docs).

davidortinau and others added 3 commits April 10, 2026 15:44
Demonstrates the new LongPressGestureRecognizer API introduced in
dotnet/maui#33432, including:

- Command binding and LongPressed event
- MinimumPressDuration (750ms) and AllowableMovement threshold
- NumberOfTouchesRequired (iOS/Mac Catalyst)
- Real-time state tracking via LongPressing event and GestureStatus
- Position detection via GetPosition()
- Combining LongPress with TapGestureRecognizer on the same element
- MVVM pattern with docregion markers for docs snippet extraction

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
…on Android, fix UI issues

- Add TapGestureRecognizer to BoxView to distinguish tap from long press
- Hide two-finger demo on Android/Windows (iOS/Mac Catalyst only feature)
- Fix BoxView dark background behind rounded corners (BackgroundColor=Transparent)
- Remove confusing 'context menu here' text from image long press
- Remove section numbering from demo titles
- Decouple image long press from BoxView color change command
- Bump Android SupportedOSPlatformVersion to 23 (Preview 3 requirement)
- Bump Mac Catalyst SupportedOSPlatformVersion to 17

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants