语言

TapGestureRecognizer 类

定义

提供点击手势识别和事件。

public sealed class TapGestureRecognizer : Xamarin.Forms.GestureRecognizer
type TapGestureRecognizer = class
    inherit GestureRecognizer
继承
System.Object
TapGestureRecognizer

注解

可用于识别单个和多个点击手势。

构造函数

名称 说明
TapGestureRecognizer()

初始化 TapGestureRecognizer 对象的新实例。

TapGestureRecognizer(Action<View,Object>)
已过时.

使用参数化回调初始化 TapGestureRecognizer 对象的新实例。

TapGestureRecognizer(Action<View>)
已过时.

使用回调初始化 TapGestureRecognizer 对象的新实例。

字段

名称 说明
CommandParameterProperty

标识 CommandParameter 可绑定属性。

CommandProperty

标识 Command 可绑定属性。

NumberOfTapsRequiredProperty

标识 NumberOfTapsRequired 可绑定属性。

TappedCallbackParameterProperty
已过时.

标识 TappedCallbackParameter 可绑定属性。

TappedCallbackProperty
已过时.

标识 TappedCallback 可绑定属性。

属性

名称 说明
AutomationId

获取或设置允许自动化框架查找此元素并与其交互的值。

(继承自 Element)
BindingContext

获取或设置一个对象,该对象包含由属于此 BindableObject属性的绑定属性所面向的属性。

(继承自 BindableObject)
ClassId

获取或设置用于标识语义相似元素集合的值。

(继承自 Element)
Command

当用户触发手势时要调用的命令。 这是一种可绑定属性。

CommandParameter

要传递给 TappedCallback 的对象。 这是一种可绑定属性。

Dispatcher

提供点击手势识别和事件。

(继承自 BindableObject)
EffectControlProvider

供Xamarin内部使用。窗体平台。

(继承自 Element)
Effects

应用于此项的效果的列表。

(继承自 Element)
Id

获取一个值,该值可用于通过应用程序运行唯一标识元素。

(继承自 Element)
LogicalChildren

供Xamarin内部使用。窗体平台。

(继承自 Element)
NumberOfTapsRequired

触发回调所需的点击数。 这是一种可绑定属性。

Parent

获取或设置元素的父元素。

(继承自 Element)
ParentView
已过时.

获取作为此元素最接近的上级元素的 VisualElement元素。

(继承自 Element)
Platform
已过时.

提供点击手势识别和事件。

(继承自 Element)
RealParent

供Xamarin内部使用。窗体平台。

(继承自 Element)
StyleId

获取或设置用于唯一地标识元素的用户定义的值。

(继承自 Element)
TappedCallback
已过时.

当用户触发手势时要调用的操作。 这是一种可绑定属性。

TappedCallbackParameter
已过时.

要传递给 TappedCallback 的对象。 这是一种可绑定属性。

方法

名称 说明
ApplyBindings()

将绑定应用到 BindingContext.

(继承自 BindableObject)
ClearValue(BindableProperty)

清除为 SetValueproperty.. 设置的任何值。

(继承自 BindableObject)
ClearValue(BindablePropertyKey)

清除为 SetValue 由 propertyKey标识的属性设置的任何值。

(继承自 BindableObject)
CoerceValue(BindableProperty)

提供点击手势识别和事件。

(继承自 BindableObject)
CoerceValue(BindablePropertyKey)

提供点击手势识别和事件。

(继承自 BindableObject)
Descendants()

供Xamarin内部使用。窗体平台。

(继承自 Element)
EffectIsAttached(String)

供Xamarin内部使用。窗体平台。

(继承自 Element)
FindByName(String)

返回具有指定名称的元素。

(继承自 Element)
GetValue(BindableProperty)

返回 BindableProperty 中包含的值。

(继承自 BindableObject)
GetValues(BindableProperty, BindableProperty, BindableProperty)
已过时.

供Xamarin内部使用。窗体平台。

(继承自 BindableObject)
GetValues(BindableProperty, BindableProperty)
已过时.

供Xamarin内部使用。窗体平台。

(继承自 BindableObject)
IsSet(BindableProperty)

返回 true 目标属性是否存在且已设置。

(继承自 BindableObject)
OnBindingContextChanged()

每当元素的绑定上下文发生更改时就会调用。 实现此方法可为此事件添加类处理。

(继承自 Element)
OnChildAdded(Element)

每当需要发出事件时 ChildAdded 调用。 实现此方法可为此事件添加类处理。

(继承自 Element)
OnChildRemoved(Element, Int32)

提供点击手势识别和事件。

(继承自 Element)
OnChildRemoved(Element)
已过时.

每当需要发出事件时 ChildRemoved 调用。 实现此方法可为此事件添加类处理。

(继承自 Element)
OnParentSet()

每当设置元素的父级时调用。 实现此方法以便在将元素添加到父元素时添加行为。

(继承自 Element)
OnPropertyChanged(String)

更改绑定属性时调用的方法。

(继承自 Element)
OnPropertyChanging(String)

从子类调用此方法,以通知属性上将发生更改。

(继承自 BindableObject)
RemoveBinding(BindableProperty)

删除以前设置的绑定。

(继承自 BindableObject)
RemoveDynamicResource(BindableProperty)

删除以前设置的动态资源

(继承自 Element)
SendTapped(View)

供Xamarin内部使用。窗体平台。

SetBinding(BindableProperty, BindingBase)

向属性分配绑定。

(继承自 BindableObject)
SetDynamicResource(BindableProperty, String)

使用提供的键设置要通过 DynamicResource 更新此元素的 BindableProperty 属性。

(继承自 Element)
SetValue(BindableProperty, Object)

设置指定属性的值。

(继承自 BindableObject)
SetValue(BindablePropertyKey, Object)

设置 propertyKey 的值。

(继承自 BindableObject)
SetValueCore(BindableProperty, Object, SetValueFlags)

供Xamarin内部使用。窗体平台。

(继承自 BindableObject)
SetValueFromRenderer(BindableProperty, Object)

供Xamarin内部使用。窗体平台。

(继承自 Element)
SetValueFromRenderer(BindablePropertyKey, Object)

供Xamarin内部使用。窗体平台。

(继承自 Element)
UnapplyBindings()

取消应用以前设置的所有绑定。

(继承自 BindableObject)

活动

名称 说明
BindingContextChanged

每当 BindingContext 属性更改时引发。

(继承自 BindableObject)
ChildAdded

每当将子元素添加到元素时发生。

(继承自 Element)
ChildRemoved

每当从元素中删除子元素时发生。

(继承自 Element)
DescendantAdded

每当将子元素添加到元素子树时发生。

(继承自 Element)
DescendantRemoved

每当从元素子树中删除子元素时发生。

(继承自 Element)
PlatformSet
已过时.

提供点击手势识别和事件。

(继承自 Element)
PropertyChanged

属性发生更改时引发。

(继承自 BindableObject)
PropertyChanging

当属性即将更改时引发。

(继承自 BindableObject)
Tapped

用户点击时引发的事件。

显式接口实现

名称 说明
IDynamicResourceHandler.SetDynamicResource(BindableProperty, String)

供Xamarin内部使用。窗体平台。

(继承自 BindableObject)
IElementController.SetValueFromRenderer(BindableProperty, Object)

供Xamarin内部使用。窗体平台。

(继承自 Element)
INameScope.RegisterName(String, Object)

仅供内部使用。

(继承自 Element)

扩展方法

名称 说明
FindByName<T>(Element, String)

返回范围中包含element名称name的类型T实例。

GetPropertyIfSet<T>(BindableObject, BindableProperty, T)

提供点击手势识别和事件。

SetAppThemeColor(BindableObject, BindableProperty, Color, Color)

提供点击手势识别和事件。

SetBinding(BindableObject, BindableProperty, String, BindingMode, IValueConverter, String)

创建绑定并将其应用到属性。

SetBinding<TSource>(BindableObject, BindableProperty, Expression<Func<TSource,Object>>, BindingMode, IValueConverter, String)
已过时.

从表达式创建并应用绑定。

SetOnAppTheme<T>(BindableObject, BindableProperty, T, T)

提供点击手势识别和事件。

适用于