Table of Contents

Interface ICreatesObservableForProperty


ICreatesObservableForProperty represents an object that knows how to create notifications for a given type of object. Implement this if you are porting RxUI to a new UI toolkit, or generally want to enable WhenAny for another type of object that can be observed in a unique way.

public interface ICreatesObservableForProperty : IEnableLogger


GetAffinityForObject(Type, string, bool)

Returns a positive integer when this class supports GetNotificationForProperty for this particular Type. If the method isn't supported at all, return a non-positive integer. When multiple implementations return a positive value, the host will use the one which returns the highest value. When in doubt, return '2' or '0'.

int GetAffinityForObject(Type type, string propertyName, bool beforeChanged = false)


type Type

The type to query for.

propertyName string

The property of the type to query for.

beforeChanged bool

If true, returns whether GNFP is supported before a change occurs.



A positive integer if GNFP is supported, zero or a negative value otherwise.

GetNotificationForProperty(object, Expression, string, bool, bool)

Subscribe to notifications on the specified property, given an object and a property name.

IObservable<IObservedChange<object?, object?>> GetNotificationForProperty(object sender, Expression expression, string propertyName, bool beforeChanged = false, bool suppressWarnings = false)


sender object

The object to observe.

expression Expression

The expression on the object to observe. This will be either a MemberExpression or an IndexExpression depending on the property.

propertyName string

The property of the type to query for.

beforeChanged bool

If true, signal just before the property value actually changes. If false, signal after the property changes.

suppressWarnings bool

If true, no warnings should be logged.


IObservable<IObservedChange<object, object>>

An IObservable which is signaled whenever the specified property on the object changes. If this cannot be done for a specified value of beforeChanged, return Observable.Never.