Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FrameworkElement.GetBindingExpression Method

Returns the BindingExpression that represents the binding on the specified property.

Namespace:  System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)

public BindingExpression GetBindingExpression(
	DependencyProperty dp
)

Parameters

dp
Type: System.Windows.DependencyProperty

The target DependencyProperty to get the binding from.

Return Value

Type: System.Windows.Data.BindingExpression
A BindingExpression if the target property has an active binding; otherwise, returns null.

Checking the return value for null is a technique you can use to determine whether a property has an active binding.

This method is really just a convenience wrapper around the BindingOperations.GetBindingExpression method. GetBindingExpression passes the current instance and the dp parameter to BindingOperations.GetBindingExpression.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
Show:
© 2015 Microsoft