You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I needed pointer gesture recognizers in an app that I am working on and it seems that command parameters in pointer gesture recognizer are type of ICommand and not object, my project is on .NET 7
Provides pointer gesture recognition and events.
public sealed class PointerGestureRecognizer : GestureRecognizer
{
///
/// The command to invoke when the pointer has entered the view. This is a bindable property.
///
public static readonly BindableProperty PointerEnteredCommandProperty;
///
/// An object to be passed to PointerEnteredCommand. This is a bindable property.
///
public static readonly BindableProperty PointerEnteredCommandParameterProperty;
///
/// The command to invoke when the pointer has exited the view. This is a bindable property.
///
public static readonly BindableProperty PointerExitedCommandProperty;
///
/// An object to be passed to PointerExitedCommand. This is a bindable property.
///
public static readonly BindableProperty PointerExitedCommandParameterProperty;
///
/// The command to invoke when the pointer has moved within the view. This is a bindable property.
///
public static readonly BindableProperty PointerMovedCommandProperty;
///
/// An object to be passed to the PointerMovedCommand. This is a bindable property.
///
public static readonly BindableProperty PointerMovedCommandParameterProperty;
/// Raised when the pointer enters the view.
public event EventHandler? PointerEntered;
/// Raised when the pointer exits the view.
public event EventHandler? PointerExited;
/// Raised when the pointer moves within the view.
public event EventHandler? PointerMoved;
///
/// Identifies the PointerEnteredCommand bindable property.
///
public ICommand PointerEnteredCommand { get; set; }
///
/// Identifies the PointerEnteredCommandParameter bindable property.
///
public ICommand PointerEnteredCommandParameter { get; set; }
///
/// Identifies the PointerExitedCommand bindable property.
///
public ICommand PointerExitedCommand { get; set; }
///
/// Identifies the PointerExitedCommandParameter bindable property.
///
public ICommand PointerExitedCommandParameter { get; set; }
/// Identifies the PointerMovedCommand bindable property.
public ICommand PointerMovedCommand { get; set; }
///
/// Identifies the PointerMovedCommandParameter bindable property.
///
public ICommand PointerMovedCommandParameter { get; set; }
}
}`
here is as screenshot as well:
I found one discussion on this exact topic but it was closed without resolving anything due to lack of information so can somebody help me with this?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I needed pointer gesture recognizers in an app that I am working on and it seems that command parameters in pointer gesture recognizer are type of ICommand and not object, my project is on .NET 7
`using System;
using System.Windows.Input;
#nullable enable
namespace Microsoft.Maui.Controls
{
///
public sealed class PointerGestureRecognizer : GestureRecognizer
{
///
/// The command to invoke when the pointer has entered the view. This is a bindable property.
///
public static readonly BindableProperty PointerEnteredCommandProperty;
///
/// An object to be passed to PointerEnteredCommand. This is a bindable property.
///
public static readonly BindableProperty PointerEnteredCommandParameterProperty;
///
/// The command to invoke when the pointer has exited the view. This is a bindable property.
///
public static readonly BindableProperty PointerExitedCommandProperty;
///
/// An object to be passed to PointerExitedCommand. This is a bindable property.
///
public static readonly BindableProperty PointerExitedCommandParameterProperty;
///
/// The command to invoke when the pointer has moved within the view. This is a bindable property.
///
public static readonly BindableProperty PointerMovedCommandProperty;
///
/// An object to be passed to the PointerMovedCommand. This is a bindable property.
///
public static readonly BindableProperty PointerMovedCommandParameterProperty;
///
public event EventHandler? PointerEntered;
///
public event EventHandler? PointerExited;
///
public event EventHandler? PointerMoved;
///
/// Identifies the PointerEnteredCommand bindable property.
///
public ICommand PointerEnteredCommand { get; set; }
///
/// Identifies the PointerEnteredCommandParameter bindable property.
///
public ICommand PointerEnteredCommandParameter { get; set; }
///
/// Identifies the PointerExitedCommand bindable property.
///
public ICommand PointerExitedCommand { get; set; }
///
/// Identifies the PointerExitedCommandParameter bindable property.
///
public ICommand PointerExitedCommandParameter { get; set; }
///
public ICommand PointerMovedCommand { get; set; }
///
/// Identifies the PointerMovedCommandParameter bindable property.
///
public ICommand PointerMovedCommandParameter { get; set; }
}
}`
here is as screenshot as well:

I found one discussion on this exact topic but it was closed without resolving anything due to lack of information so can somebody help me with this?
Beta Was this translation helpful? Give feedback.
All reactions