FrameworkElement.GetBindingExpression(DependencyProperty) FrameworkElement.GetBindingExpression(DependencyProperty) FrameworkElement.GetBindingExpression(DependencyProperty) FrameworkElement.GetBindingExpression(DependencyProperty) Method

定義

傳回 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 DependencyProperty DependencyProperty 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.

適用於

另請參閱