Skip to content

})} },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)

View source

Summary: ObservableForProperty by name, observing after-change, emitting the initial value, with distinct filtering.

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 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, bool skipInitial)

View source

Summary: ObservableForProperty by name, observing after-change with distinct filtering and a configurable initial value.

Type parameters

NameDescription
TSenderThe sender type.
TValueThe value type.

Parameters

NameTypeDescription
itemTSender?The source object to observe properties of.
propertyNamestringThe property name to observe.
skipInitialboolIf true, the Observable will not notify with the initial value.

Returns: IObservable> -- An Observable representing the property change notifications 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, bool skipInitial, bool isDistinct)

View source

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

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.

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)

View source

Summary: ObservableForProperty by expression, observing after-change, emitting the initial value, with distinct filtering.

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.

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

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)

View source

Summary: ObservableForProperty by expression, observing after-change with distinct filtering and a configurable initial value.

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.
skipInitialboolIf true, the Observable will not notify with the initial value.

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, bool skipInitial, bool isDistinct)

View source

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

NameDescription
TSenderThe sender type.
TValueThe value type.

Parameters

NameTypeDescription
itemTSender?The source object to observe properties of.
propertyExpression>An Expression representing the property.
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.