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,否則傳回 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

適用於