TwoWayBindingCreateTSourceOwner, TSource, TTargetOwner, TTarget Method (IPropertyTSourceOwner, TSource, FuncTSource, TTarget, IPropertyTTargetOwner, TTarget, FuncTTarget, TSource) | |
Creates a two-way binding between source and target.
Namespace: Lawo.ComponentModelAssembly: Lawo (in Lawo.dll) Version: 1.4.1707.27006
Syntax public static Binding<TSourceOwner, TSource, TTargetOwner, TTarget> Create<TSourceOwner, TSource, TTargetOwner, TTarget>(
IProperty<TSourceOwner, TSource> source,
Func<TSource, TTarget> toTarget,
IProperty<TTargetOwner, TTarget> target,
Func<TTarget, TSource> toSource
)
where TSourceOwner : INotifyPropertyChanged
where TTargetOwner : INotifyPropertyChanged
Parameters
- source
- Type: Lawo.ReflectionIPropertyTSourceOwner, TSource
- toTarget
- Type: SystemFuncTSource, TTarget
- target
- Type: Lawo.ReflectionIPropertyTTargetOwner, TTarget
- toSource
- Type: SystemFuncTTarget, TSource
Type Parameters
- TSourceOwner
- The type of the object owning the source property.
- TSource
- The type of the source property.
- TTargetOwner
- The type of the object owning the target property.
- TTarget
- The type of the target property.
Return Value
Type:
BindingTSourceOwner,
TSource,
TTargetOwner,
TTargetExceptions Remarks Firstly, the value of
target.
Value is set to the
one of
toTarget(
source.
Value). Secondly,
a separate handler is added to the
PropertyChanged event of both
properties. After establishing that a property participating in the binding has been changed, the respective
handler sets the value of the other participating property to the (appropriately converted) value of the
changed property.
See Also