The recording of the first ever ReactiveUI virtual conference is available on our YouTube Channel.

ReactiveObject Class

Summary

ReactiveObject is the base object for ViewModel classes, and it implements INotifyPropertyChanged. In addition, ReactiveObject provides Changing and Changed Observables to monitor object changes.
graph BT Type-->Base0["object"] Type-.->Interface0["IReactiveNotifyPropertyChanged<IReactiveObject>"] Type-.->Interface1["IHandleObservableErrors"] click Interface1 "/api/ReactiveUI/IHandleObservableErrors" Type-.->Interface2["IReactiveObject"] click Interface2 "/api/ReactiveUI/IReactiveObject" Type-.->Interface3["INotifyPropertyChanged"] Type-.->Interface4["INotifyPropertyChanging"] Type-.->Interface5["IEnableLogger"] click Interface5 "/api/Splat/IEnableLogger" Type["ReactiveObject"] class Type type-node Derived0["BasePropertyValidation<TViewModel>"]-->Type click Derived0 "/api/ReactiveUI.Validation.Components/BasePropertyValidation_1" Derived1["ValidationContext"]-->Type click Derived1 "/api/ReactiveUI.Validation.Contexts/ValidationContext" Derived2["ValidationHelper"]-->Type click Derived2 "/api/ReactiveUI.Validation.Helpers/ValidationHelper" Derived3["ParameterViewModel"]-->Type click Derived3 "/api/Sextant.Mocks/ParameterViewModel" Derived4["ObservableValidationBase<TViewModel, TValue>"]-->Type click Derived4 "/api/ReactiveUI.Validation.Components/ObservableValidationBase_2" Derived5["RoutingState"]-->Type click Derived5 "/api/ReactiveUI/RoutingState" Derived6["MockViewModel"]-->Type click Derived6 "/api/ReactiveUI.Benchmarks/MockViewModel" Derived7["ReactiveValidationObject"]-->Type click Derived7 "/api/ReactiveUI.Validation.Helpers/ReactiveValidationObject"

Syntax

[DataContract]
public class ReactiveObject : IReactiveNotifyPropertyChanged<IReactiveObject>, 
    IHandleObservableErrors, IReactiveObject, INotifyPropertyChanged, INotifyPropertyChanging, 
    IEnableLogger

Attributes

Type Description
DataContract

Constructors

Name Summary
ReactiveObject() Initializes a new instance of the ReactiveObject class.

Events

Name Type Summary
PropertyChanged PropertyChangedEventHandler?
PropertyChanging PropertyChangingEventHandler?

Properties

Name Value Summary
Changed IObservable<IReactivePropertyChangedEventArgs<IReactiveObject>>
Gets an Observable that fires *after* a property has changed. Note that this should not fire duplicate change notifications if a property is set to the same value multiple times.
Changing IObservable<IReactivePropertyChangedEventArgs<IReactiveObject>>
Gets an observable that fires *before* a property is about to be changed. Note that this should not fire duplicate change notifications if a property is set to the same value multiple times.
ThrownExceptions IObservable<Exception>
Gets a observable which will fire whenever an exception would normally terminate ReactiveUI internal state.

Methods

Name Value Summary
AreChangeNotificationsEnabled() bool
Determines if change notifications are enabled or not.
DelayChangeNotifications() IDisposable
Delays notifications until the return IDisposable is disposed.
SuppressChangeNotifications() IDisposable
When this method is called, an object will not fire change notifications (neither traditional nor Observable notifications) until the return value is disposed.

Extension Methods

Name Value Summary
AutoPersist<ReactiveObject, TDontCare>(Func<ReactiveObject, IObservable<Unit>>, IObservable<TDontCare>, TimeSpan?) IDisposable
AutoPersist allows you to automatically call a method when an object has changed, throttling on a certain interval. Note that this object must mark its persistable properties via the [DataMember] attribute. Changes to properties not marked with DataMember will not trigger the object to be saved.
AutoPersist<ReactiveObject>(Func<ReactiveObject, IObservable<Unit>>, TimeSpan?) IDisposable
AutoPersist allows you to automatically call a method when an object has changed, throttling on a certain interval. Note that this object must mark its persistable properties via the [DataMember] attribute. Changes to properties not marked with DataMember will not trigger the object to be saved.
BindCommand<ReactiveObject, TViewModel, TProp, TControl, TParam>(TViewModel?, Expression<Func<TViewModel, TProp?>>, Expression<Func<ReactiveObject, TControl>>, Expression<Func<TViewModel, TParam?>>, string?) IReactiveBinding<TView, TProp>
Bind a command from the ViewModel to an explicitly specified control on the View.
BindCommand<ReactiveObject, TViewModel, TProp, TControl, TParam>(TViewModel?, Expression<Func<TViewModel, TProp?>>, Expression<Func<ReactiveObject, TControl>>, IObservable<TParam?>, string?) IReactiveBinding<TView, TProp>
Bind a command from the ViewModel to an explicitly specified control on the View.
BindCommand<ReactiveObject, TViewModel, TProp, TControl>(TViewModel?, Expression<Func<TViewModel, TProp?>>, Expression<Func<ReactiveObject, TControl>>, string?) IReactiveBinding<TView, TProp>
Bind a command from the ViewModel to an explicitly specified control on the View.
BindValidation<ReactiveObject, TViewModel, TViewModelProperty, TViewProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty>>, Expression<Func<ReactiveObject, TViewProperty>>, IValidationTextFormatter<string>?) IDisposable
Binds the specified ViewModel property validation to the View property.
BindValidation<ReactiveObject, TViewModel, TViewModelProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty?>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidation<ReactiveObject, TViewModel, TViewModelProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty?>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidation<ReactiveObject, TViewModel, TViewProperty>(TViewModel?, Expression<Func<ReactiveObject, TViewProperty>>, IValidationTextFormatter<string>?) IDisposable
Binds the overall validation of a ViewModel to a specified View property.
BindValidation<ReactiveObject, TViewModel, TViewProperty>(TViewModel?, Expression<Func<TViewModel?, ValidationHelper?>>, Expression<Func<ReactiveObject, TViewProperty>>, IValidationTextFormatter<string>?) IDisposable
Binds a ValidationHelper from a ViewModel to a specified View property.
BindValidation<ReactiveObject, TViewModel>(TViewModel?, Expression<Func<TViewModel?, ValidationHelper?>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidation<ReactiveObject, TViewModel>(TViewModel?, Expression<Func<TViewModel?, ValidationHelper?>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidationEx<ReactiveObject, TViewModel, TViewModelProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty?>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
BindValidationEx<ReactiveObject, TViewModel, TViewModelProperty>(TViewModel?, Expression<Func<TViewModel, TViewModelProperty?>>, TextInputLayout, IValidationTextFormatter<string>?) IDisposable
Platform binding to the TextInputLayout.
InvokeViewModelAction<T>(Action<T>) object
This is a thing I lifted from Prism.
Log<ReactiveObject>() IFullLogger
Call this method to write log entries on behalf of the current class.
From LogHost
RaiseAndSetIfChanged<ReactiveObject, TRet>(TRet, TRet, string?) TRet
RaiseAndSetIfChanged fully implements a Setter for a read-write property on a ReactiveObject, using CallerMemberName to raise the notification and the ref to the backing field to set the property.
RaisePropertyChanged<ReactiveObject>(string?) void
Use this method in your ReactiveObject classes when creating custom properties where raiseAndSetIfChanged doesn't suffice.
RaisePropertyChanging<ReactiveObject>(string?) void
Use this method in your ReactiveObject classes when creating custom properties where raiseAndSetIfChanged doesn't suffice.
SubscribePropertyChangedEvents<ReactiveObject>() void
Use this method for enabling classic PropertyChanged events when you are implementing IReactiveObject manually.
SubscribePropertyChangingEvents<ReactiveObject>() void
Use this method for enabling classic PropertyChanging events when you are implementing IReactiveObject manually.
WhenAnyObservable<ReactiveObject, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, T12>(Expression<Func<ReactiveObject, IObservable<T1>?>>, Expression<Func<ReactiveObject, IObservable<T2>?>>, Expression<Func<ReactiveObject, IObservable<T3>?>>, Expression<Func<ReactiveObject, IObservable<T4>?>>, Expression<Func<ReactiveObject, IObservable<T5>?>>, Expression<Func<ReactiveObject, IObservable<T6>?>>, Expression<Func<ReactiveObject, IObservable<T7>?>>, Expression<Func<ReactiveObject, IObservable<T8>?>>, Expression<Func<ReactiveObject, IObservable<T9>?>>, Expression<Func<ReactiveObject, IObservable<T10>?>>, Expression<Func<ReactiveObject, IObservable<T11>?>>, Expression<Func<ReactiveObject, IObservable<T12>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, T7?, T8?, T9?, T10?, T11?, T12?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11>(Expression<Func<ReactiveObject, IObservable<T1>?>>, Expression<Func<ReactiveObject, IObservable<T2>?>>, Expression<Func<ReactiveObject, IObservable<T3>?>>, Expression<Func<ReactiveObject, IObservable<T4>?>>, Expression<Func<ReactiveObject, IObservable<T5>?>>, Expression<Func<ReactiveObject, IObservable<T6>?>>, Expression<Func<ReactiveObject, IObservable<T7>?>>, Expression<Func<ReactiveObject, IObservable<T8>?>>, Expression<Func<ReactiveObject, IObservable<T9>?>>, Expression<Func<ReactiveObject, IObservable<T10>?>>, Expression<Func<ReactiveObject, IObservable<T11>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, T7?, T8?, T9?, T10?, T11?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9, T10>(Expression<Func<ReactiveObject, IObservable<T1>?>>, Expression<Func<ReactiveObject, IObservable<T2>?>>, Expression<Func<ReactiveObject, IObservable<T3>?>>, Expression<Func<ReactiveObject, IObservable<T4>?>>, Expression<Func<ReactiveObject, IObservable<T5>?>>, Expression<Func<ReactiveObject, IObservable<T6>?>>, Expression<Func<ReactiveObject, IObservable<T7>?>>, Expression<Func<ReactiveObject, IObservable<T8>?>>, Expression<Func<ReactiveObject, IObservable<T9>?>>, Expression<Func<ReactiveObject, IObservable<T10>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, T7?, T8?, T9?, T10?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet, T1, T2, T3, T4, T5, T6, T7, T8, T9>(Expression<Func<ReactiveObject, IObservable<T1>?>>, Expression<Func<ReactiveObject, IObservable<T2>?>>, Expression<Func<ReactiveObject, IObservable<T3>?>>, Expression<Func<ReactiveObject, IObservable<T4>?>>, Expression<Func<ReactiveObject, IObservable<T5>?>>, Expression<Func<ReactiveObject, IObservable<T6>?>>, Expression<Func<ReactiveObject, IObservable<T7>?>>, Expression<Func<ReactiveObject, IObservable<T8>?>>, Expression<Func<ReactiveObject, IObservable<T9>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, T7?, T8?, T9?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet, T1, T2, T3, T4, T5, T6, T7, T8>(Expression<Func<ReactiveObject, IObservable<T1>?>>, Expression<Func<ReactiveObject, IObservable<T2>?>>, Expression<Func<ReactiveObject, IObservable<T3>?>>, Expression<Func<ReactiveObject, IObservable<T4>?>>, Expression<Func<ReactiveObject, IObservable<T5>?>>, Expression<Func<ReactiveObject, IObservable<T6>?>>, Expression<Func<ReactiveObject, IObservable<T7>?>>, Expression<Func<ReactiveObject, IObservable<T8>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, T7?, T8?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet, T1, T2, T3, T4, T5, T6, T7>(Expression<Func<ReactiveObject, IObservable<T1>?>>, Expression<Func<ReactiveObject, IObservable<T2>?>>, Expression<Func<ReactiveObject, IObservable<T3>?>>, Expression<Func<ReactiveObject, IObservable<T4>?>>, Expression<Func<ReactiveObject, IObservable<T5>?>>, Expression<Func<ReactiveObject, IObservable<T6>?>>, Expression<Func<ReactiveObject, IObservable<T7>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, T7?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet, T1, T2, T3, T4, T5, T6>(Expression<Func<ReactiveObject, IObservable<T1>?>>, Expression<Func<ReactiveObject, IObservable<T2>?>>, Expression<Func<ReactiveObject, IObservable<T3>?>>, Expression<Func<ReactiveObject, IObservable<T4>?>>, Expression<Func<ReactiveObject, IObservable<T5>?>>, Expression<Func<ReactiveObject, IObservable<T6>?>>, Func<T1?, T2?, T3?, T4?, T5?, T6?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet, T1, T2, T3, T4, T5>(Expression<Func<ReactiveObject, IObservable<T1>?>>, Expression<Func<ReactiveObject, IObservable<T2>?>>, Expression<Func<ReactiveObject, IObservable<T3>?>>, Expression<Func<ReactiveObject, IObservable<T4>?>>, Expression<Func<ReactiveObject, IObservable<T5>?>>, Func<T1?, T2?, T3?, T4?, T5?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet, T1, T2, T3, T4>(Expression<Func<ReactiveObject, IObservable<T1>?>>, Expression<Func<ReactiveObject, IObservable<T2>?>>, Expression<Func<ReactiveObject, IObservable<T3>?>>, Expression<Func<ReactiveObject, IObservable<T4>?>>, Func<T1?, T2?, T3?, T4?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet, T1, T2, T3>(Expression<Func<ReactiveObject, IObservable<T1>?>>, Expression<Func<ReactiveObject, IObservable<T2>?>>, Expression<Func<ReactiveObject, IObservable<T3>?>>, Func<T1?, T2?, T3?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet, T1, T2>(Expression<Func<ReactiveObject, IObservable<T1>?>>, Expression<Func<ReactiveObject, IObservable<T2>?>>, Func<T1?, T2?, TRet>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet>(Expression<Func<ReactiveObject, IObservable<TRet>?>>) IObservable<TRet>
Observe a observable which is set to a property, and automatically subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet>(Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet>(Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet>(Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet>(Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet>(Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet>(Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet>(Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet>(Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet>(Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet>(Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
WhenAnyObservable<ReactiveObject, TRet>(Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>, Expression<Func<ReactiveObject, IObservable<TRet>?>>) IObservable<TRet>
Monitor a property that is an observable, and subscribe to the most recent emitted value.
With<ReactiveObject, TKey, TField>(Dictionary<TKey, TField>, IDictionary<TKey, TField>) TBuilder
Adds the specified dictionary to the provided dictionary.