Summary
WhenAny allows you to observe whenever one or more properties on an
object have changed, providing an initial value when the Observable
is set up, unlike ObservableForProperty(). Use this method in
constructors to set up bindings between properties that also need an
initial setup.
Syntax
public static IObservable<TRet> WhenAny<TSender, TRet, T1, T2>(this TSender sender, Expression<Func<TSender, T1>> property1, Expression<Func<TSender, T2>> property2, Func<IObservedChange<TSender, T1>, IObservedChange<TSender, T2>, TRet> selector)
Type Parameters
Name |
Description |
TSender |
|
TRet |
|
T1 |
|
T2 |
|
Parameters
Name |
Type |
Description |
sender |
TSender |
The object where the property chain starts. |
property1 |
Expression<Func<TSender, T1>> |
The 1 property chain to reference. This will be a expression pointing to a end property or field. |
property2 |
Expression<Func<TSender, T2>> |
The 2 property chain to reference. This will be a expression pointing to a end property or field. |
selector |
Func<IObservedChange<TSender, T1>, IObservedChange<TSender, T2>, TRet> |
The selector which will determine the final value from the properties. |
Return Value
Type |
Description |
IObservable<TRet> |
|