})} },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)
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
| Name | Description |
|---|---|
TSender | The sender type. |
TValue | The value type. |
Parameters
| Name | Type | Description |
|---|---|---|
item | TSender? | The source object to observe properties of. |
propertyName | string | The property name to observe. |
beforeChange | bool | If true, the Observable will notify immediately before a property is going to change. |
skipInitial | bool | If true, the Observable will not notify with the initial value. |
isDistinct | bool | If set to true, values are filtered with DistinctUntilChanged. |
Returns: IObservable
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)
Summary: ObservableForProperty overload that avoids expression trees by using only a property name.
Type parameters
| Name | Description |
|---|---|
TSender | The sender type. |
TValue | The value type. |
Parameters
| Name | Type | Description |
|---|---|---|
item | TSender? | The source object to observe properties of. |
propertyName | string | The property name to observe. |
Returns: IObservable
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)
Summary: ObservableForProperty overload that avoids expression trees by using a property name and beforeChange option.
Type parameters
| Name | Description |
|---|---|
TSender | The sender type. |
TValue | The value type. |
Parameters
| Name | Type | Description |
|---|---|---|
item | TSender? | The source object to observe properties of. |
propertyName | string | The property name to observe. |
beforeChange | bool | If true, the observable will notify immediately before a property is going to change. |
Returns: IObservable
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)
Summary: ObservableForProperty overload that avoids expression trees by using a property name with options to control initial emission and beforeChange.
Type parameters
| Name | Description |
|---|---|
TSender | The sender type. |
TValue | The value type. |
Parameters
| Name | Type | Description |
|---|---|---|
item | TSender? | The source object to observe properties of. |
propertyName | string | The property name to observe. |
beforeChange | bool | If true, the observable will notify immediately before a property is going to change. |
skipInitial | bool | If true, the observable will not notify with the initial value. |
Returns: IObservable
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)
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
| Name | Description |
|---|---|
TSender | The sender type. |
TValue | The value type. |
Parameters
| Name | Type | Description |
|---|---|---|
item | TSender? | The source object to observe properties of. |
property | Expression | An Expression representing the property (i.e. 'x => x.SomeProperty.SomeOtherProperty'. |
Returns: IObservable
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)
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
| Name | Description |
|---|---|
TSender | The sender type. |
TValue | The value type. |
Parameters
| Name | Type | Description |
|---|---|---|
item | TSender? | The source object to observe properties of. |
property | Expression | An Expression representing the property (i.e. 'x => x.SomeProperty.SomeOtherProperty'. |
beforeChange | bool | If True, the Observable will notify immediately before a property is going to change. |
Returns: IObservable
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)
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
| Name | Description |
|---|---|
TSender | The sender type. |
TValue | The value type. |
Parameters
| Name | Type | Description |
|---|---|---|
item | TSender? | The source object to observe properties of. |
property | Expression | An Expression representing the property (i.e. 'x => x.SomeProperty.SomeOtherProperty'. |
beforeChange | bool | If True, the Observable will notify immediately before a property is going to change. |
skipInitial | bool | If true, the Observable will not notify with the initial value. |
Returns: IObservable
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)
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
| Name | Description |
|---|---|
TSender | The sender type. |
TValue | The value type. |
Parameters
| Name | Type | Description |
|---|---|---|
item | TSender? | The source object to observe properties of. |
property | Expression | An Expression representing the property (i.e. 'x => x.SomeProperty.SomeOtherProperty'. |
beforeChange | bool | If True, the Observable will notify immediately before a property is going to change. |
skipInitial | bool | If true, the Observable will not notify with the initial value. |
isDistinct | bool | if set to true [is distinct]. |
Returns: IObservable
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
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
| Name | Description |
|---|---|
TSender | The sender type. |
TValue | The value type. |
TRet | The return value type. |
Parameters
| Name | Type | Description |
|---|---|---|
item | TSender? | The source object to observe properties of. |
property | Expression | An Expression representing the property (i.e. 'x => x.SomeProperty'. |
selector | Func | A Select function that will be run on each item. |
Returns: IObservable
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
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
| Name | Description |
|---|---|
TSender | The sender type. |
TValue | The value type. |
TRet | The return value type. |
Parameters
| Name | Type | Description |
|---|---|---|
item | TSender? | The source object to observe properties of. |
property | Expression | An Expression representing the property (i.e. 'x => x.SomeProperty'. |
selector | Func | 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. |
Returns: IObservable