Binding for joining two object bindings together
Remarks: The DualBinding is the most useful binding, as it allows you to bind two objects together. This differs from the IndirectBinding<T> where it only specifies how to get/set the value from a single object.
Type parameters:
| T |
Constructors
DualBinding
#public DualBinding(DirectBinding<T> source, DirectBinding<T> destination, DualBindingMode mode = DualBindingMode.TwoWay)
Initializes a new instance of the DualBinding class with two specified bindings
Parameters:
| source (DirectBinding<T>) | Binding for retrieving the source value from |
| destination (DirectBinding<T>) | Binding for setting the destination value to |
| mode (DualBindingMode = DualBindingMode.TwoWay) | Mode of the binding |
DualBinding
#public DualBinding(object source, string sourceProperty, object destination, string destinationProperty, DualBindingMode mode = DualBindingMode.TwoWay)
Initializes a new instance of the DualBinding class with two object property bindings
Parameters:
| source (object) | Object to retrieve the source value from |
| sourceProperty (string) | Property to retrieve from the source |
| destination (object) | Object to set the destination value to |
| destinationProperty (string) | Property to set on the destination |
| mode (DualBindingMode = DualBindingMode.TwoWay) | Mode of the binding |
Properties
Methods
inherited fromBinding
inherited fromBinding
SetDestination
#public void SetDestination()
Sets the destination object's property with the value of the source
SetSource
#public void SetSource()
Sets the source object's property with the value of the destination
ToString
#Returns a String that represents the current DualBinding.
Returns: A String that represents the current DualBinding.
Overrides: Object.ToString
Update
#Updates the binding value (sets the source with the value of the destination)
Parameters:
| mode (BindingUpdateMode = BindingUpdateMode.Destination) |
Overrides: Binding.Update
Events
Changed
Event to handle after the value has been set using this binding
Changing
Event to handle when the value is being set using this binding
Remarks: This can be used to stop a value being updated based on custom logic