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 擲回。

備註

在 readonly 屬性上呼叫這個方法會導致 InvalidOperationException。

適用於