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

定义

返回表示指定属性的绑定的 BindingExpressionReturns 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.

适用于

另请参阅