OneWayBindingCreateTSourceOwner, TSource, TTargetOwner, TTarget Method (IPropertyTSourceOwner, TSource, FuncTSource, TTarget, IPropertyTTargetOwner, TTarget) | |
Creates a one-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
)
where TSourceOwner : INotifyPropertyChanged
where TTargetOwner : INotifyPropertyChanged
Parameters
- source
- Type: Lawo.ReflectionIPropertyTSourceOwner, TSource
- toTarget
- Type: SystemFuncTSource, TTarget
- target
- Type: Lawo.ReflectionIPropertyTTargetOwner, TTarget
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 handler is added to the
PropertyChanged event of the source property.
After establishing that the source property has been changed, the handler sets the value of the target
property to the (appropriately converted) value of the source property.
See Also