Skip to content

Add LongPressGestureRecognizer sample for .NET MAUI 11#752

Merged
jfversluis merged 9 commits intomainfrom
sample-longpress-gesture
Apr 14, 2026
Merged

Add LongPressGestureRecognizer sample for .NET MAUI 11#752
jfversluis merged 9 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 5 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>
…ckages, add position tracking

- Replace manual INotifyPropertyChanged with ObservableObject/ObservableProperty/RelayCommand
- Pin NuGet packages to preview 3 (11.0.0-preview.3.26203.7)
- Add ValidateXcodeVersion=false for preview SDK compatibility
- Add position tracking via e.GetPosition() in OnLongPressing handler
 DisplayAlertAsync deprecation
- Remove unused global usings

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jfversluis and others added 2 commits April 14, 2026 22:26
Replace hardcoded package versions with $(MauiVersion) and $(DotNetVersion).
Remove per-project ValidateXcodeVersion (inherited from Directory.Build.props).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
jfversluis and others added 2 commits April 14, 2026 22:58
Fixes CS5001 build error on Windows by adding the required
Platforms/Windows/ files (App.xaml, App.xaml.cs, Package.appxmanifest,
app.manifest).

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jfversluis jfversluis merged commit 35277b2 into main Apr 14, 2026
3 checks passed
@jfversluis jfversluis deleted the sample-longpress-gesture branch April 14, 2026 21:15
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