Assembly: System.Windows (in System.Windows.dll)
'Declaration Public Function SetBinding ( _ dp As DependencyProperty, _ binding As Binding _ ) As BindingExpressionBase
- Type: System.Windows.DependencyProperty
The dependency property identifier of the property that is data bound.
- Type: System.Windows.Data.Binding
The binding to use for the property.
The returned binding expression is not necessary for many of the common binding scenarios, but is potentially useful for scenarios such as updating the source manually, or getting references to the parent Binding after the expression is created. The BindingExpressionBase class is a base class. In most cases you should attempt to cast the return value to BindingExpression, which is the class that implements the relevant API for the mentioned update or Binding parent scenarios.
The following example establishes a binding to a dependency property on an object by calling .