The recording of the first ever ReactiveUI virtual conference is available on our YouTube Channel.

WhenAnyMixin.

WhenAnyValue<TSender, TRet, T1>(TSender, Expression<Func<TSender, T1>>, Func<T1, TRet>) Method

Summary

WhenAnyValue allows you to observe whenever the value of 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.
Namespace
ReactiveUI
Containing Type
WhenAnyMixin

Syntax

public static IObservable<TRet> WhenAnyValue<TSender, TRet, T1>(this TSender sender, Expression<Func<TSender, T1>> property1, Func<T1, TRet> selector)

Type Parameters

Name Description
TSender
TRet
T1

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.
selector Func<T1, TRet> The selector which will determine the final value from the properties.

Return Value

Type Description
IObservable<TRet>