AutoSuspendHelper(IApplicationLifetime) constructor¶
Defined in
Type: AutoSuspendHelper
Namespace: ReactiveUI.Avalonia.Reactive
Assembly: ReactiveUI.Avalonia.Reactive.dll
Applies to
net10.0, net9.0, net8.0
public AutoSuspendHelper(IApplicationLifetime lifetime)
Summary: Initializes a new instance of the AutoSuspendHelper class.
Parameters
| Name | Type | Description |
|---|---|---|
lifetime | IApplicationLifetime | The application lifetime object used to determine how application exit and state persistence events are handled. Must not be null. |
Remarks
If the application is running in design mode, state persistence is disabled. For supported lifetimes, application exit events are wired to enable state persistence. This constructor should be called after Avalonia application initialization is completed.
Exceptions
| Type | Condition |
|---|---|
| System.NotSupportedException | Thrown if the specified application lifetime type is not supported for detecting application exit events. |
| System.ArgumentNullException | Thrown if lifetime is null. |