BindableObject.ClearValue 方法

定义

重载

ClearValue(BindableProperty)

清除以前为可绑定属性设置的任何值。

ClearValue(BindablePropertyKey)

清除以前为可绑定属性设置的任何值(由其键标识)。

ClearValue(BindableProperty)

清除以前为可绑定属性设置的任何值。

public:
 void ClearValue(Microsoft::Maui::Controls::BindableProperty ^ property);
public void ClearValue (Microsoft.Maui.Controls.BindableProperty property);
member this.ClearValue : Microsoft.Maui.Controls.BindableProperty -> unit
Public Sub ClearValue (property As BindableProperty)

参数

property
BindableProperty

BindableProperty 清除其值的 。

例外

propertynull 时,将引发此异常。

注解

如果 property 为只读,则不会发生任何操作。

适用于

ClearValue(BindablePropertyKey)

清除以前为可绑定属性设置的任何值(由其键标识)。

public:
 void ClearValue(Microsoft::Maui::Controls::BindablePropertyKey ^ propertyKey);
public void ClearValue (Microsoft.Maui.Controls.BindablePropertyKey propertyKey);
member this.ClearValue : Microsoft.Maui.Controls.BindablePropertyKey -> unit
Public Sub ClearValue (propertyKey As BindablePropertyKey)

参数

propertyKey
BindablePropertyKey

标识要为其清除值的可绑定属性的键。

例外

propertyKeynull 时,将引发此异常。

当 是只读属性时 propertyKey 引发。

注解

对只读属性调用此方法将导致 InvalidOperationException。

适用于