FrameworkElement.GetBindingExpression Method
.NET Framework 4.6 and 4.5
Returns the BindingExpression that represents the binding on the specified property.
Namespace: System.Windows
Assembly: PresentationFramework (in PresentationFramework.dll)
Parameters
- dp
- Type: System.Windows.DependencyProperty
The target DependencyProperty to get the binding from.
Return Value
Type: System.Windows.Data.BindingExpressionA 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.
Show: