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


ObservableForProperty<TSender, TValue, TRet>(TSender, Expression<Func<TSender, TValue>>, Func<TValue, TRet>, bool) Method


ObservableForProperty returns an Observable representing the property change notifications for a specific property on a ReactiveObject, running the IObservedChange through a Selector function.


public static IObservable<TRet> ObservableForProperty<TSender, TValue, TRet>(this TSender item, Expression<Func<TSender, TValue>> property, Func<TValue, TRet> selector, bool beforeChange = false) 
    where TSender : class

Type Parameters

Name Description
TSender The sender type.
TValue The value type.
TRet The return value type.


Name Type Description
item TSender The source object to observe properties of.
property Expression<Func<TSender, TValue>> An Expression representing the property (i.e. 'x => x.SomeProperty'.
selector Func<TValue, TRet> A Select function that will be run on each item.
beforeChange bool If True, the Observable will notify immediately before a property is going to change.

Return Value

Type Description
IObservable<TRet> An Observable representing the property change notifications for the given property.