FrameworkElement.GetBindingExpression(DependencyProperty) 方法

定義

傳回 BindingExpression,代表指定屬性的繫結。Returns the BindingExpression that represents the binding on the specified property.

public:
 System::Windows::Data::BindingExpression ^ GetBindingExpression(System::Windows::DependencyProperty ^ dp);
public System.Windows.Data.BindingExpression GetBindingExpression (System.Windows.DependencyProperty dp);
member this.GetBindingExpression : System.Windows.DependencyProperty -> System.Windows.Data.BindingExpression
Public Function GetBindingExpression (dp As DependencyProperty) As BindingExpression

參數

dp
DependencyProperty

要從中取得繫結的目標 DependencyPropertyThe target DependencyProperty to get the binding from.

傳回

如果目標屬性具有使用中的繫結程序,則為 BindingExpression;否則會傳回 nullA BindingExpression if the target property has an active binding; otherwise, returns null.

備註

檢查 null 的傳回值,是您可以用來判斷屬性是否具有使用中系結的技術。Checking the return value for null is a technique you can use to determine whether a property has an active binding.

這個方法其實只是 BindingOperations.GetBindingExpression 方法的便利包裝函式。This method is really just a convenience wrapper around the BindingOperations.GetBindingExpression method. GetBindingExpression 會將目前的實例和 dp 參數傳遞至 BindingOperations.GetBindingExpressionGetBindingExpression passes the current instance and the dp parameter to BindingOperations.GetBindingExpression.

適用於

另請參閱