FrameworkContentElement.GetBindingExpression(DependencyProperty) 方法

定义

获取 BindingExpression 指定属性的绑定。

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

返回

如果目标已绑定数据,则返回 ; BindingExpression 否则返回 null

示例

以下示例通过查询属性来检索绑定。

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

适用于