Skip to content

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)

View source

Summary: Initializes a new instance of the AutoSuspendHelper class.

Parameters

NameTypeDescription
lifetimeIApplicationLifetimeThe 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

TypeCondition
System.NotSupportedExceptionThrown if the specified application lifetime type is not supported for detecting application exit events.
System.ArgumentNullExceptionThrown if lifetime is null.