IReactiveObject
trait · ferroui-reactiveui · v0.5.0
trait IReactiveObject: INotifyPropertyChanged + INotifyPropertyChanging + IEnableLogger + 'static
A view model that notifies when its properties are changing and have changed
(IReactiveObject); reactive_object! implements it for a type that
holds a ReactiveObject.
The raising methods go through the state of the object: they follow its suppression and delay, and feed both the events and the observables of the changes. Helpers outside the object, such as the helper of a derived property, raise the changes of the object through them.
Deviation (DEVIATIONS.md, ReactiveUI): upstream's IReactiveObjectStateSlot, the optional slot
that holds the state on the object, is reactive_object: every
reactive object holds its state, since there is no table of states keyed by object
(ConditionalWeakTable).
Deviation (DEVIATIONS.md, ReactiveUI): upstream's RaisePropertyChanging(PropertyChangingEventArgs)
and RaisePropertyChanged(PropertyChangedEventArgs) invoke the events, and the extension
methods of the same names go through the state. The two cannot share a name in Rust (a call
would be ambiguous), so these methods are the extension methods, and the state raises the
events of the ReactiveObject itself.
Members
reactive_object
fn reactive_object(self: &Self) -> &ReactiveObject
The part that holds the events and the state of the change notifications
(IReactiveObjectStateSlot.GetReactiveStateSlot).
raise_property_changing
fn raise_property_changing(self: &Self, property_name: &str)
Raises the notifications of a property that is about to change: the PropertyChanging
event and the Changing observable (RaisePropertyChanging(string)). For properties
whose setter does more than raise_and_set_if_changed.
raise_property_changed
fn raise_property_changed(self: &Self, property_name: &str)
Raises the notifications of a property that changed: the PropertyChanged event and the
Changed observable (RaisePropertyChanged(string)).
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.