Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/fundamentals/gestures/tap.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ ms.date: 10/03/2022

A .NET Multi-platform App UI (.NET MAUI) tap gesture recognizer is used for tap detection and is implemented with the <xref:Microsoft.Maui.Controls.TapGestureRecognizer> class. This class defines the following properties:

- <xref:Microsoft.Maui.Controls.TapGestureRecognizer.Buttons>, of type <xref:Microsoft.Maui.Controls.ButtonsMask>, which defines whether the primary or secondary mouse button, or both, triggers the gesture on Mac Catalyst and Windows. For more information, see [Define the button masks](#define-the-button-mask).
- <xref:Microsoft.Maui.Controls.TapGestureRecognizer.Buttons>, of type <xref:Microsoft.Maui.Controls.ButtonsMask>, which defines whether the primary or secondary mouse button, or both, triggers the gesture on Android, Mac Catalyst, and Windows. For more information, see [Define the button masks](#define-the-button-mask).
- <xref:Microsoft.Maui.Controls.TapGestureRecognizer.Command>, of type `ICommand`, which is executed when a tap is recognized.
- <xref:Microsoft.Maui.Controls.TapGestureRecognizer.CommandParameter>, of type `object`, which is the parameter that's passed to the `Command`.
- <xref:Microsoft.Maui.Controls.TapGestureRecognizer.NumberOfTapsRequired>, of type `int`, which represents the number of taps required to recognize a tap gesture. The default value of this property is 1.

These properties are backed by <xref:Microsoft.Maui.Controls.BindableProperty> objects, which means that they can be targets of data bindings, and styled.

The <xref:Microsoft.Maui.Controls.TapGestureRecognizer> class also defines a <xref:Microsoft.Maui.Controls.TapGestureRecognizer.Tapped> event that's raised when a tap is recognized. The <xref:Microsoft.Maui.Controls.TappedEventArgs> object that accompanies the <xref:Microsoft.Maui.Controls.TapGestureRecognizer.Tapped> event defines a <xref:Microsoft.Maui.Controls.TappedEventArgs.Parameter> property of type `object` that indicates the value passed by the `CommandParameter` property, if defined. The <xref:Microsoft.Maui.Controls.TappedEventArgs> object also defines a <xref:Microsoft.Maui.Controls.TappedEventArgs.Buttons> property, and a `GetPosition` method. The <xref:Microsoft.Maui.Controls.TappedEventArgs.Buttons> property is of type <xref:Microsoft.Maui.Controls.ButtonsMask>, and can be used to determine whether the primary or secondary mouse button triggered the gesture recognizer on Mac Catalyst and Windows. The `GetPosition` method returns a `Point?` object that represents the position at which the tap gesture was detected. For more information about button masks, see [Define the button mask](#define-the-button-mask). For more information about the `GetPosition` method, see [Get the gesture position](#get-the-gesture-position).
The <xref:Microsoft.Maui.Controls.TapGestureRecognizer> class also defines a <xref:Microsoft.Maui.Controls.TapGestureRecognizer.Tapped> event that's raised when a tap is recognized. The <xref:Microsoft.Maui.Controls.TappedEventArgs> object that accompanies the <xref:Microsoft.Maui.Controls.TapGestureRecognizer.Tapped> event defines a <xref:Microsoft.Maui.Controls.TappedEventArgs.Parameter> property of type `object` that indicates the value passed by the `CommandParameter` property, if defined. The <xref:Microsoft.Maui.Controls.TappedEventArgs> object also defines a <xref:Microsoft.Maui.Controls.TappedEventArgs.Buttons> property, and a `GetPosition` method. The <xref:Microsoft.Maui.Controls.TappedEventArgs.Buttons> property is of type <xref:Microsoft.Maui.Controls.ButtonsMask>, and can be used to determine whether the primary or secondary mouse button triggered the gesture recognizer on Android, Mac Catalyst, and Windows. The `GetPosition` method returns a `Point?` object that represents the position at which the tap gesture was detected. For more information about button masks, see [Define the button mask](#define-the-button-mask). For more information about the `GetPosition` method, see [Get the gesture position](#get-the-gesture-position).

> [!WARNING]
> A <xref:Microsoft.Maui.Controls.TapGestureRecognizer> can't recognize more than a double tap on Windows.
Expand Down Expand Up @@ -58,7 +58,7 @@ By default the <xref:Microsoft.Maui.Controls.Image> will respond to single taps.

## Define the button mask

A <xref:Microsoft.Maui.Controls.TapGestureRecognizer> object has a <xref:Microsoft.Maui.Controls.TapGestureRecognizer.Buttons> property, of type <xref:Microsoft.Maui.Controls.ButtonsMask>, that defines whether the primary or secondary mouse button, or both, triggers the gesture on Mac Catalyst and Windows. The <xref:Microsoft.Maui.Controls.ButtonsMask> enumeration defines the following members:
A <xref:Microsoft.Maui.Controls.TapGestureRecognizer> object has a <xref:Microsoft.Maui.Controls.TapGestureRecognizer.Buttons> property, of type <xref:Microsoft.Maui.Controls.ButtonsMask>, that defines whether the primary or secondary mouse button, or both, triggers the gesture on Android, Mac Catalyst, and Windows. The <xref:Microsoft.Maui.Controls.ButtonsMask> enumeration defines the following members:

- <xref:Microsoft.Maui.Controls.ButtonsMask.Primary> represents the primary mouse button, which is typically the left mouse button.
- <xref:Microsoft.Maui.Controls.ButtonsMask.Secondary> represents the secondary mouse button, which is typically the right mouse button.
Expand Down
1 change: 1 addition & 0 deletions docs/whats-new/dotnet-8.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ For information about what's new in .NET 8, see [What's new in .NET 8](/dotnet/c
- The `Grid.Add` overload that accepts 5 arguments has been added back to .NET MAUI. However, this method is deprecated and is only present to aid migrations from Xamarin.Forms.
- <xref:Microsoft.Maui.Controls.Grid> gains an `AddWithSpan` extension method that adds a view to the `Grid` at the specified row and column with the specified row and column spans.
- On iOS, `MauiUIApplicationDelegate` gains a `PerformFetch` method that can be overridden or consumed via the `iOSLifecycle.PerformFetch` delegate. For more information, see [iOS platform lifecycle events](~/fundamentals/app-lifecycle.md#ios).
- The <xref:Microsoft.Maui.Controls.TapGestureRecognizer> class gains the ability to handle secondary taps on Android. For more information, see [Recognize a tap gesture](~/fundamentals/gestures/tap.md).

The following types or members have been deprecated:

Expand Down