Skip to content

AutoSuspendHelper class

Attributes: [DebuggerDisplay("AutoSuspendHelper: {_shouldPersistState}")]

Defined in

Namespace: ReactiveUI.Avalonia.Reactive Assembly: ReactiveUI.Avalonia.Reactive.dll Full name: ReactiveUI.Avalonia.Reactive.AutoSuspendHelper Modifiers: public sealed

Summary

View source

Provides automatic suspension and state persistence support for Avalonia applications.

Applies to

net10.0, net9.0, net8.0

Class hierarchy
classDiagram
class AutoSuspendHelper
class IEnableLogger {
    <>
}
IEnableLogger <|.. AutoSuspendHelper
class IDisposable {
    <>
}
IDisposable <|.. AutoSuspendHelper

Implements: IEnableLogger, IDisposable

Remarks

Use this helper to enable automatic state persistence and restoration in Avalonia applications. Pass the application's lifetime object to the constructor, and call OnFrameworkInitializationCompleted in your App.OnFrameworkInitializationCompleted method to signal application launch. This class integrates with ReactiveUI's RxSuspension system and handles application exit and unhandled exceptions to manage state persistence. It is not intended for use in design mode, where state persistence is disabled.

Constructors

NameSummary
.ctorInitializes a new instance of the [AutoSuspendHelper](# class.

Methods

NameSummary
OnFrameworkInitializationCompletedSignals that the framework initialization process has completed.
DisposeReleases all resources used by the current instance.
Inherited members