Table of Contents

Class BaseActiveAwareViewModel

Namespace
Innova.Prism.Library.BaseViewModels
Assembly
Innova.Prism.Library.dll

Represents a base view model that implements the Prism.IActiveAware interface. This view model serves as a foundation for view models that need to be aware of their active state, providing a standardized approach to managing subscriptions and other active state-dependent behaviors.

public class BaseActiveAwareViewModel : BindableBase, INotifyPropertyChanged, IActiveAware
Inheritance
BaseActiveAwareViewModel
Implements
IActiveAware
Derived

Properties

IsActive

Gets or sets a value indicating whether the view model is active. When set, it triggers the IsActiveChanged event and manages the subscription tokens accordingly.

Tokens

Holds the subscription tokens for event aggregation subscriptions.

Methods

AddSubscriptions()

Adds the subscriptions associated with this view model. This method should be overridden in derived classes to add specific event subscriptions.

OnIsActiveChanged()

Raises the IsActiveChanged event and manages the addition or removal of subscriptions based on the active state.

RemoveSubscriptions()

Removes the subscriptions associated with this view model. This method disposes of all subscription tokens, effectively unsubscribing from events.

Events

IsActiveChanged

Occurs when the IsActive property value has changed.