GetBindingExpression Method

FrameworkElement.GetBindingExpression Method (DependencyProperty)

 

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
Available since 3.0
Silverlight
Available since 3.0
Windows Phone Silverlight
Available since 7.0
Return to top
Show:
© 2016 Microsoft