Skip to content

ViewForMixins class

Defined in

Namespace: ReactiveUI.Reactive Assembly: ReactiveUI.Reactive.dll Full name: ReactiveUI.Reactive.ViewForMixins Modifiers: public static

Summary

View source

        Provides extension methods for registering activation logic on views and view models that support activation. These
        methods enable the execution of custom code when a view or view model is activated or deactivated, facilitating
        resource management and lifecycle handling in reactive UI scenarios.
        

Applies to

net10.0, net10.0-maccatalyst26.0, net10.0-desktop1.0, net10.0-browserwasm1.0, net10.0-tvos26.0, net10.0-windows10.0.19041, net10.0-macos26.0, net10.0-ios26.0, net10.0-android36.0, net9.0, net9.0-tvos18.0, net9.0-macos15.0, net9.0-maccatalyst18.0, net9.0-windows10.0.19041, net9.0-ios18.0, net9.0-desktop1.0, net8.0, net8.0-windows10.0.19041, net8.0-ios18.0, net8.0-maccatalyst18.0, net8.0-macos15.0, net8.0-tvos18.0, net8.0-ios17.5, net8.0-maccatalyst17.5, net8.0-macos14.5, netstandard2.1, net481, net462, net471

Remarks

The methods in this class are typically used to register disposables or cleanup actions that should be tied to the activation lifecycle of a view or view model. This helps ensure that resources such as subscriptions are properly disposed of when the view is deactivated. Some methods accept an optional view parameter for advanced scenarios where the view and view model are not hosted together. Use these methods to simplify activation-aware resource management in MVVM architectures. Thread safety and correct disposal are managed internally. For unit testing purposes, the cache used to optimize activation fetcher lookups can be reset using the provided internal method; this should not be used in production code.

Methods

NameSummary
static WhenActivated
static GetIsDesignMode
Inherited members

Extension blocks

extension(IActivatableView item)

  • WhenActivated
  • WhenActivated
  • WhenActivated
  • WhenActivated
  • WhenActivated
  • WhenActivated
  • WhenActivated
  • WhenActivated
  • WhenActivated
  • WhenActivated
  • WhenActivated
  • GetIsDesignMode

extension(IActivatableViewModel item)

  • WhenActivated
  • WhenActivated
  • WhenActivated