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


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.

Legacy Code Example

Code snippet is not found. Confirm that the code snippet name 'HOWDOI' is correct.

.NET Framework
Available since 3.0
Available since 3.0
Windows Phone Silverlight
Available since 7.0
Return to top
© 2015 Microsoft