FrameworkContentElement.GetBindingExpression(DependencyProperty) 方法

定义

获取指定属性的绑定的 BindingExpressionGets the BindingExpression for the specified property's binding.

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 from which to get the binding.

返回

BindingExpression

如果目标为数据绑定,则返回 BindingExpression;否则返回 nullReturns a BindingExpression if the target is data bound; otherwise, null.

示例

下面的示例通过查询属性来检索绑定。The following example retrieves a binding by querying a property.

Binding binding = introParagraph.GetBindingExpression(FrameworkContentElement.TagProperty).ParentBinding;
Dim binding As Binding = introParagraph.GetBindingExpression(FrameworkContentElement.TagProperty).ParentBinding

适用于