Behavior<T> 类

定义

用于广义用户定义行为的泛型基类可以响应任意条件和事件。

public abstract class Behavior<T> : Xamarin.Forms.Behavior where T : BindableObject
type Behavior<'T (requires 'T :> BindableObject)> = class
    inherit Behavior

类型参数

T

可以与之 Behavior<T> 关联的对象的类型。

继承
System.Object
Behavior<T>

注解

应用程序开发人员应专门化此泛型类,而不是直接使用 Behavior

构造函数

Behavior<T>()

创建一个新的 Behavior<T> 实例。

属性

AssociatedType

获取 Behavior 可与之关联的对象类型。

(继承自 Behavior)
BindingContext

获取或设置对象,该对象包含将被属于此 BindableObject 的绑定属性设定为目标的属性。

(继承自 BindableObject)
Dispatcher

用于广义用户定义行为的泛型基类可以响应任意条件和事件。

(继承自 BindableObject)

方法

ApplyBindings()

将绑定应用到 BindingContext

(继承自 BindableObject)
ClearValue(BindableProperty)

清除由 SetValueproperty 设置的任何值。

(继承自 BindableObject)
ClearValue(BindablePropertyKey)

清除由 SetValuepropertyKey 标识的属性设置的任何值。

(继承自 BindableObject)
CoerceValue(BindableProperty)

用于广义用户定义行为的泛型基类可以响应任意条件和事件。

(继承自 BindableObject)
CoerceValue(BindablePropertyKey)

用于广义用户定义行为的泛型基类可以响应任意条件和事件。

(继承自 BindableObject)
GetValue(BindableProperty)

返回 BindableProperty 中包含的值。

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

供 Xamarin.Forms 平台内部使用。

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

供 Xamarin.Forms 平台内部使用。

(继承自 BindableObject)
IsSet(BindableProperty)

如果目标属性存在并且已设置,则返回 true

(继承自 BindableObject)
OnAttachedTo(BindableObject)

附加到超类,然后在此对象上调用 OnAttachedTo(T) 方法。

OnAttachedTo(T)

应用程序开发者可重写此方法以实现与 bindable 关联的行为。

OnBindingContextChanged()

替代此方法以在 BindingContext 更改时执行操作。

(继承自 BindableObject)
OnDetachingFrom(BindableObject)

调用 OnDetachingFrom(T) 方法,然后从超类中拆离。

OnDetachingFrom(T)

应用程序开发者可重写此方法,从先前调用 OnAttachedTo(T) 方法实现的 bindable 中删除行为。

OnPropertyChanged(String)

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

(继承自 BindableObject)
OnPropertyChanging(String)

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

(继承自 BindableObject)
RemoveBinding(BindableProperty)

删除先前设置的绑定。

(继承自 BindableObject)
SetBinding(BindableProperty, BindingBase)

向属性分配绑定。

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

设置指定属性的值。

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

设置 propertyKey 的值。

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

供 Xamarin.Forms 平台内部使用。

(继承自 BindableObject)
UnapplyBindings()

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

(继承自 BindableObject)

事件

BindingContextChanged

只要 BindingContext 属性更改就会引发。

(继承自 BindableObject)
PropertyChanged

在属性已更改时引发。

(继承自 BindableObject)
PropertyChanging

在属性将要更改时引发。

(继承自 BindableObject)

显式接口实现

IDynamicResourceHandler.SetDynamicResource(BindableProperty, String)

供 Xamarin.Forms 平台内部使用。

(继承自 BindableObject)

扩展方法

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)

用于广义用户定义行为的泛型基类可以响应任意条件和事件。

适用于

另请参阅