BindableObject.ClearValue 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
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 清除值的 。
例外狀況
當 property
為 null
時擲回。
備註
當 為唯讀時 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
識別可系結屬性以清除值的索引鍵。
例外狀況
當 propertyKey
為 null
時擲回。
當 是只讀屬性時 propertyKey
擲回。
備註
在 readonly 屬性上呼叫這個方法會導致 InvalidOperationException。
適用於
意見反應
https://aka.ms/ContentUserFeedback。
即將登場:在 2024 年,我們將逐步淘汰 GitHub 問題作為內容的意見反應機制,並將它取代為新的意見反應系統。 如需詳細資訊,請參閱:提交並檢視相關的意見反應