DualBinding<T>

BindingReferences
public class DualBinding<T> : Binding
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.
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
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
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

HandleEvent

protected virtual void HandleEvent(string id)
Called to handle an event for this binding
inherited fromBinding

RemoveEvent

protected virtual void RemoveEvent(string id)
Called to remove an event for this binding
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

#
public override string ToString()
Returns a String that represents the current DualBinding.

Unbind

#
public override void Unbind()
Unbinds both the source and destination bindings

Update

#
public override void Update(BindingUpdateMode mode = BindingUpdateMode.Destination)
Updates the binding value (sets the source with the value of the destination)

Events

Changing

public event EventHandler<BindingChangingEventArgs> Changing
Event to handle when the value is being set using this binding
inherited fromBinding
Remarks: This can be used to stop a value being updated based on custom logic