})} },System.Boolean)} },System.Boolean,System.Boolean,System.Boolean)}
ReactiveNotifyPropertyChangedMixin.ObservableForProperty(TSender?, string) method¶
Defined in
Type: ReactiveNotifyPropertyChangedMixin
Namespace: ReactiveUI.Binding.ObservableForProperty
Assembly: ReactiveUI.Binding.dll
Applies to
net10.0, net10.0-browserwasm1.0, net10.0-desktop1.0, net9.0, net9.0-browserwasm1.0, net9.0-desktop1.0, net8.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.2, net8.0-macos14.5, net8.0-tvos17.2, netstandard2.1, net462, net481
Overloads¶
- 1.
public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, string propertyName) - 2.
public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, string propertyName, bool skipInitial) - 3.
public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, string propertyName, bool beforeChange, bool skipInitial, bool isDistinct) - 4.
public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, Expression<Func<TSender, TValue>> property) - 5.
public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, Expression<Func<TSender, TValue>> property, bool skipInitial) - 6.
public static IObservable<IObservedChange<TSender, TValue>> ObservableForProperty<TSender, TValue>(this TSender? item, Expression<Func<TSender, TValue>> property, bool beforeChange, bool skipInitial, bool isDistinct)
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)
Summary: ObservableForProperty by name, observing after-change, emitting the initial value, with distinct filtering.
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
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, bool skipInitial)
Summary: ObservableForProperty by name, observing after-change with distinct filtering and a configurable initial value.
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. |
skipInitial | bool | If true, the Observable will not notify with the initial value. |
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, bool skipInitial, bool isDistinct)
Summary: ObservableForProperty returns an Observable representing the property change notifications for a specific property on an object. This overload avoids expression tree analysis by using a property name string.
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
4. 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 by expression, observing after-change, emitting the initial value, with distinct filtering.
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. |
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, bool skipInitial)
Summary: ObservableForProperty by expression, observing after-change with distinct filtering and a configurable initial value.
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. |
skipInitial | bool | If true, the Observable will not notify with the initial value. |
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, bool skipInitial, bool isDistinct)
Summary: ObservableForProperty returns an Observable representing the property change notifications for a specific property on an object. This method uses expression trees to identify the property.
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. |
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