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¶
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¶
| Name | Summary |
|---|---|
| .ctor | Initializes a new instance of the [AutoSuspendHelper](# class. |
Methods¶
| Name | Summary |
|---|---|
| OnFrameworkInitializationCompleted | Signals that the framework initialization process has completed. |
| Dispose | Releases all resources used by the current instance. |