From 118c6b74b12461f50d4667d7e103ea22cf488640 Mon Sep 17 00:00:00 2001 From: David Britch Date: Mon, 16 Oct 2023 10:12:30 +0100 Subject: [PATCH 1/2] Added PlatformPointerEventArgs --- docs/fundamentals/gestures/pointer.md | 22 ++++++++++++++++++---- docs/whats-new/dotnet-8.md | 2 +- 2 files changed, 19 insertions(+), 5 deletions(-) diff --git a/docs/fundamentals/gestures/pointer.md b/docs/fundamentals/gestures/pointer.md index 185f54c764..bf82b4637c 100644 --- a/docs/fundamentals/gestures/pointer.md +++ b/docs/fundamentals/gestures/pointer.md @@ -1,7 +1,7 @@ --- title: "Recognize a pointer gesture" description: "Learn how to use the PointerGestureRecognizer class, to detect when the pointer enters, exits, and moves within a view on iPadOS, Mac Catalyst, and Windows." -ms.date: 10/02/2023 +ms.date: 10/16/2023 --- # Recognize a pointer gesture @@ -44,6 +44,8 @@ The class also defines t - , that's raised when the pointer that's in the view's bounding area leaves that bounding area. - , that's raised when the pointer moves while remaining within the bounding area of the view. +A object accompanies the events, and defines a `GetPosition` method that returns a `Point?` object that represents the position of the pointer when the gesture was detected. For more information about the `GetPosition` method, see [Get the gesture position](#get-the-gesture-position). + ::: moniker-end ::: moniker range=">=net-maui-8.0" @@ -54,12 +56,24 @@ The class also defines t - `PointerPressed`, that's raised when the pointer initiates a press within the view. - `PointerReleased`, that's raised when the pointer that has previously initiated a press is released, while within the view. -::: moniker-end +A object accompanies the events, and defines a `PlatformArgs` property of type `PlatformPointerEventArgs` that provides access to platform-specific arguments for the event. The `PlatformPointerEventArgs` class defines the following properties: + +- Android + - `Sender`, of type , represents the native view attached to the event. + - `MotionEvent`, of type , indicates the native event or handler attached to the view. +- iOS/Mac Catalyst + - `Sender`, of type , represents the native view attached to the event. + - `GestureRecognizer`, of type , indicates the native event or handler attached to the view. +- Windows + - `Sender`, of type , represents the native view attached to the event. + - `PointerRoutedEventArgs`, of type , indicates the native event or handler attached to the view. -A object accompanies all three events, and defines a `GetPosition` method that returns a `Point?` object that represents the position of the pointer when the gesture was detected. For more information about the `GetPosition` method, see [Get the gesture position](#get-the-gesture-position). +In addition, the object defines a `GetPosition` method that returns a `Point?` object that represents the position of the pointer when the gesture was detected. For more information about the `GetPosition` method, see [Get the gesture position](#get-the-gesture-position). + +::: moniker-end > [!IMPORTANT] -> Pointer gesture recognition is only supported on iPadOS, Mac Catalyst, and Windows. +> Pointer gesture recognition is supported on Android, iPadOS, Mac Catalyst, and Windows. .NET MAUI also defines a `PointerOver` visual state. This state can change the visual appearance of a view when it has a mouse cursor hovering over it, but isn't pressed. For more information, see [Visual states](~/user-interface/visual-states.md). diff --git a/docs/whats-new/dotnet-8.md b/docs/whats-new/dotnet-8.md index 7ca33d2952..56c35d5819 100644 --- a/docs/whats-new/dotnet-8.md +++ b/docs/whats-new/dotnet-8.md @@ -29,7 +29,7 @@ For information about what's new in .NET 8, see [What's new in .NET 8](/dotnet/c - 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 class gains the ability to handle secondary taps on Android. For more information, see [Recognize a tap gesture](~/fundamentals/gestures/tap.md). -- Some of the common properties from the , , and controls have moved to the base class. For more information, see [Editor](~/user-interface/controls/editor.md), [Entry](~/user-interface/controls/entry.md), and [SearchBar](~/user-interface/controls/searchbar.md). +- The object that accompanies the pointer events raised by the class gains a `PlatformArgs` property of type `PlatformPointerEventArgs`. This property provides access to the platform-specific arguments for a pointer gesture event. For more information, see [Recognize a pointer gesture](~/fundamentals/gestures/pointer.md). The following types or members have been deprecated: From c44ccfdbe578f14fbdc931a231cf04dd338d37d3 Mon Sep 17 00:00:00 2001 From: David Britch Date: Mon, 16 Oct 2023 10:19:33 +0100 Subject: [PATCH 2/2] Edit. --- docs/fundamentals/gestures/pointer.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/fundamentals/gestures/pointer.md b/docs/fundamentals/gestures/pointer.md index bf82b4637c..372a3e284b 100644 --- a/docs/fundamentals/gestures/pointer.md +++ b/docs/fundamentals/gestures/pointer.md @@ -58,13 +58,13 @@ A object accompanies the events, A object accompanies the events, and defines a `PlatformArgs` property of type `PlatformPointerEventArgs` that provides access to platform-specific arguments for the event. The `PlatformPointerEventArgs` class defines the following properties: -- Android +- Android: - `Sender`, of type , represents the native view attached to the event. - `MotionEvent`, of type , indicates the native event or handler attached to the view. -- iOS/Mac Catalyst +- iOS/Mac Catalyst: - `Sender`, of type , represents the native view attached to the event. - `GestureRecognizer`, of type , indicates the native event or handler attached to the view. -- Windows +- Windows: - `Sender`, of type , represents the native view attached to the event. - `PointerRoutedEventArgs`, of type , indicates the native event or handler attached to the view.