ViewModelActivationMixins
trait · ferroui-reactiveui · v0.5.0
trait ViewModelActivationMixins: IActivatableViewModel + Sized
The activation of view models (the extension members of IActivatableViewModel in
ViewForMixins): what to do while the view model is active, registered with its
ViewModelActivator.
The blocks run when the activator is activated, and what they set up is disposed when it is
deactivated. Registering a block also makes the type of the view model known as activatable
(register_activatable_view_model), so that the views that show it activate it.
Members
when_activated
fn when_activated(self: &Self, block: impl Fn() -> Vec<Rc<dyn IDisposable>> + 'static)
Runs block on each activation; what it returns is disposed on deactivation
(WhenActivated(Func<IEnumerable<IDisposable>>)).
when_activated_register
fn when_activated_register(self: &Self, block: impl Fn(&dyn Fn(Rc<dyn IDisposable>) -> ()) -> () + 'static)
Runs block on each activation; the block registers what to dispose on deactivation with
the function it is given (WhenActivated(Action<Action<IDisposable>>)).
when_activated_disposables
fn when_activated_disposables(self: &Self, block: impl Fn(&Rc<ActivationDisposables>) -> () + 'static)
Runs block on each activation with the ActivationDisposables disposed on
deactivation (WhenActivated(Action<ActivationDisposables>)).
Trait implementations
Availability
Extracted for aarch64-apple-darwin. Cargo features are listed in the crate index.