Skip to content

})} },System.Boolean)} },System.Boolean,System.Boolean)} },System.Boolean,System.Boolean,System.Boolean)} },System.Func{--1,--2})} },System.Func{--1,--2},System.Boolean)}

ReactiveNotifyPropertyChangedMixin.ObservableForProperty(TSender?, string, bool, bool, bool) method

Defined in

Type: ReactiveNotifyPropertyChangedMixin Namespace: ReactiveUI Assembly: ReactiveUI.dll

Applies to

net10.0, net10.0-android36.0, net10.0-ios26.0, net10.0-macos26.0, net10.0-windows10.0.19041, net10.0-tvos26.0, net10.0-maccatalyst26.0, net10.0-desktop1.0, net10.0-browserwasm1.0, net9.0, net9.0-tvos18.0, net9.0-maccatalyst18.0, net9.0-windows10.0.19041, net9.0-desktop1.0, net9.0-browserwasm1.0, net9.0-macos15.0, net9.0-ios18.0, net9.0-android35.0, net8.0, net8.0-macos14.5, net8.0-macos14.2, net8.0-maccatalyst17.5, net8.0-ios17.5, net8.0-tvos18.0, net8.0-macos15.0, net8.0-ios18.0, net8.0-windows10.0.19041, net8.0-maccatalyst18.0, net8.0-tvos17.2, netstandard2.1, net481, net462

Overloads

  • 1. public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, string propertyName, bool beforeChange, bool skipInitial, bool isDistinct)
  • 2. public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, string propertyName)
  • 3. public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, string propertyName, bool beforeChange)
  • 4. public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, string propertyName, bool beforeChange, bool skipInitial)
  • 5. public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, Expression<Func<TSender, TValue>> property)
  • 6. public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, Expression<Func<TSender, TValue>> property, bool beforeChange)
  • 7. public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, Expression<Func<TSender, TValue>> property, bool beforeChange, bool skipInitial)
  • 8. public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, Expression<Func<TSender, TValue>> property, bool beforeChange, bool skipInitial, bool isDistinct)
  • 9. public static IObservable<TRet> ObservableForProperty<TSender, TValue, TRet>(this TSender? item, Expression<Func<TSender, TValue>> property, Func<TValue?, TRet> selector) where TSender : class
  • 10. public static IObservable<TRet> ObservableForProperty<TSender, TValue, TRet>(this TSender? item, Expression<Func<TSender, TValue>> property, Func<TValue?, TRet> selector, bool beforeChange) where TSender : class

1. Overload

Attributes: [RequiresUnreferencedCode("Creating Expressions requires unreferenced code because the members being referenced by the Expression may be trimmed.")]

public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, string propertyName, bool beforeChange, bool skipInitial, bool isDistinct)

View source

Summary: ObservableForProperty returns an Observable representing the property change notifications for a specific property name on a ReactiveObject (or compatible type). This overload avoids expression tree analysis to be more AOT-friendly. The returned IObservedChange instances will always have the Value property populated via reflection.

Type parameters

NameDescription
TSenderThe sender type.
TValueThe value type.

Parameters

NameTypeDescription
itemTSender?The source object to observe properties of.
propertyNamestringThe property name to observe.
beforeChangeboolIf true, the Observable will notify immediately before a property is going to change.
skipInitialboolIf true, the Observable will not notify with the initial value.
isDistinctboolIf set to true, values are filtered with DistinctUntilChanged.

Returns: IObservable> -- An Observable representing the property change notifications for the given property name.

2. Overload

Attributes: [RequiresUnreferencedCode("Creating Expressions requires unreferenced code because the members being referenced by the Expression may be trimmed.")]

public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, string propertyName)

View source

Summary: ObservableForProperty overload that avoids expression trees by using only a property name.

Type parameters

NameDescription
TSenderThe sender type.
TValueThe value type.

Parameters

NameTypeDescription
itemTSender?The source object to observe properties of.
propertyNamestringThe property name to observe.

Returns: IObservable> -- An observable sequence of observed changes for the given property name.

3. Overload

Attributes: [RequiresUnreferencedCode("Creating Expressions requires unreferenced code because the members being referenced by the Expression may be trimmed.")]

public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, string propertyName, bool beforeChange)

View source

Summary: ObservableForProperty overload that avoids expression trees by using a property name and beforeChange option.

Type parameters

NameDescription
TSenderThe sender type.
TValueThe value type.

Parameters

NameTypeDescription
itemTSender?The source object to observe properties of.
propertyNamestringThe property name to observe.
beforeChangeboolIf true, the observable will notify immediately before a property is going to change.

Returns: IObservable> -- An observable sequence of observed changes for the given property name.

4. Overload

Attributes: [RequiresUnreferencedCode("Creating Expressions requires unreferenced code because the members being referenced by the Expression may be trimmed.")]

public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, string propertyName, bool beforeChange, bool skipInitial)

View source

Summary: ObservableForProperty overload that avoids expression trees by using a property name with options to control initial emission and beforeChange.

Type parameters

NameDescription
TSenderThe sender type.
TValueThe value type.

Parameters

NameTypeDescription
itemTSender?The source object to observe properties of.
propertyNamestringThe property name to observe.
beforeChangeboolIf true, the observable will notify immediately before a property is going to change.
skipInitialboolIf true, the observable will not notify with the initial value.

Returns: IObservable> -- An observable sequence of observed changes for the given property name.

5. Overload

Attributes: [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")]

public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, Expression<Func<TSender, TValue>> property)

View source

Summary: ObservableForProperty returns an Observable representing the property change notifications for a specific property on a ReactiveObject. This method (unlike other Observables that return IObservedChange) guarantees that the Value property of the IObservedChange is set.

Type parameters

NameDescription
TSenderThe sender type.
TValueThe value type.

Parameters

NameTypeDescription
itemTSender?The source object to observe properties of.
propertyExpression>An Expression representing the property (i.e. 'x => x.SomeProperty.SomeOtherProperty'.

Returns: IObservable> -- An Observable representing the property change notifications for the given property.

6. Overload

Attributes: [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")]

public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, Expression<Func<TSender, TValue>> property, bool beforeChange)

View source

Summary: ObservableForProperty returns an Observable representing the property change notifications for a specific property on a ReactiveObject. This method (unlike other Observables that return IObservedChange) guarantees that the Value property of the IObservedChange is set.

Type parameters

NameDescription
TSenderThe sender type.
TValueThe value type.

Parameters

NameTypeDescription
itemTSender?The source object to observe properties of.
propertyExpression>An Expression representing the property (i.e. 'x => x.SomeProperty.SomeOtherProperty'.
beforeChangeboolIf True, the Observable will notify immediately before a property is going to change.

Returns: IObservable> -- An Observable representing the property change notifications for the given property.

7. Overload

Attributes: [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")]

public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, Expression<Func<TSender, TValue>> property, bool beforeChange, bool skipInitial)

View source

Summary: ObservableForProperty returns an Observable representing the property change notifications for a specific property on a ReactiveObject. This method (unlike other Observables that return IObservedChange) guarantees that the Value property of the IObservedChange is set.

Type parameters

NameDescription
TSenderThe sender type.
TValueThe value type.

Parameters

NameTypeDescription
itemTSender?The source object to observe properties of.
propertyExpression>An Expression representing the property (i.e. 'x => x.SomeProperty.SomeOtherProperty'.
beforeChangeboolIf True, the Observable will notify immediately before a property is going to change.
skipInitialboolIf true, the Observable will not notify with the initial value.

Returns: IObservable> -- An Observable representing the property change notifications for the given property.

8. Overload

Attributes: [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")]

public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, Expression<Func<TSender, TValue>> property, bool beforeChange, bool skipInitial, bool isDistinct)

View source

Summary: ObservableForProperty returns an Observable representing the property change notifications for a specific property on a ReactiveObject. This method (unlike other Observables that return IObservedChange) guarantees that the Value property of the IObservedChange is set.

Type parameters

NameDescription
TSenderThe sender type.
TValueThe value type.

Parameters

NameTypeDescription
itemTSender?The source object to observe properties of.
propertyExpression>An Expression representing the property (i.e. 'x => x.SomeProperty.SomeOtherProperty'.
beforeChangeboolIf True, the Observable will notify immediately before a property is going to change.
skipInitialboolIf true, the Observable will not notify with the initial value.
isDistinctboolif set to true [is distinct].

Returns: IObservable> -- An Observable representing the property change notifications for the given property.

9. Overload

Attributes: [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")]

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

View source

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

Type parameters

NameDescription
TSenderThe sender type.
TValueThe value type.
TRetThe return value type.

Parameters

NameTypeDescription
itemTSender?The source object to observe properties of.
propertyExpression>An Expression representing the property (i.e. 'x => x.SomeProperty'.
selectorFuncA Select function that will be run on each item.

Returns: IObservable -- An Observable representing the property change notifications for the given property.

10. Overload

Attributes: [RequiresUnreferencedCode("Evaluates expression-based member chains via reflection; members may be trimmed.")]

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

View source

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

Type parameters

NameDescription
TSenderThe sender type.
TValueThe value type.
TRetThe return value type.

Parameters

NameTypeDescription
itemTSender?The source object to observe properties of.
propertyExpression>An Expression representing the property (i.e. 'x => x.SomeProperty'.
selectorFuncA Select function that will be run on each item.
beforeChangeboolIf True, the Observable will notify immediately before a property is going to change.

Returns: IObservable -- An Observable representing the property change notifications for the given property.