BindableObject.GetValue(BindableProperty) 方法

定義

傳回包含在指定可系結屬性中的值。

public:
 System::Object ^ GetValue(Microsoft::Maui::Controls::BindableProperty ^ property);
public object GetValue (Microsoft.Maui.Controls.BindableProperty property);
member this.GetValue : Microsoft.Maui.Controls.BindableProperty -> obj
Public Function GetValue (property As BindableProperty) As Object

參數

property
BindableProperty

要為其取得值的可系結屬性。

傳回

BindableProperty 中包含的值。

例外狀況

propertynull 時擲回。

備註

GetValue(BindableProperty)SetValue(BindableProperty, Object) 是用來存取由所執行的屬性值 BindableProperty 。 也就是說,應用程式開發人員通常會藉由定義public存取子將 的結果GetValue(BindableProperty)轉換成適當型別並傳回它的屬性get,以及存取set子用來SetValue(BindableProperty, Object)在正確的屬性上設定值,來提供系結屬性的介面。 應用程式開發人員不應該在定義系結屬性介面的公用屬性中執行任何其他步驟。

適用於