Class INPCObservableForProperty
- Namespace
- ReactiveUI
- Assembly
- ReactiveUI.dll
Generates Observables based on observing INotifyPropertyChanged objects.
- Inheritance
-
INPCObservable
For Property
- Implements
- Extension Methods
Constructors
INPCObservableForProperty()
Methods
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'.
Parameters
type
TypeThe type to query for.
propertyName
stringThe property of the type to query for.
beforeChanged
boolIf true, returns whether GNFP is supported before a change occurs.
Returns
- int
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.
public IObservable<IObservedChange<object?, object?>> GetNotificationForProperty(object sender, Expression expression, string propertyName, bool beforeChanged = false, bool suppressWarnings = false)
Parameters
sender
objectThe object to observe.
expression
ExpressionThe expression on the object to observe. This will be either a MemberExpression or an IndexExpression depending on the property.
propertyName
stringThe property of the type to query for.
beforeChanged
boolIf true, signal just before the property value actually changes. If false, signal after the property changes.
suppressWarnings
boolIf true, no warnings should be logged.
Returns
- IObservable<IObserved
Change <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.