Table of Contents

Interface ISuspensionHost

Namespace
ReactiveUI
Assembly
ReactiveUI.dll

ISuspensionHost represents a standardized version of the events that the host operating system publishes. Subscribe to these events in order to handle app suspend / resume.

public interface ISuspensionHost : IReactiveObject, INotifyPropertyChanged, INotifyPropertyChanging, IEnableLogger
Inherited Members
Extension Methods

Properties

AppState

Gets or sets the current application state - get a typed version of this via GetAppState<T>(ISuspensionHost). The "application state" is a notion entirely defined via the client application - the framework places no restrictions on the object other than it can be serialized.

object? AppState { get; set; }

Property Value

object

CreateNewAppState

Gets or sets a function that can be used to create a new application state - usually this method just calls 'new' on an object.

Func<object>? CreateNewAppState { get; set; }

Property Value

Func<object>

IsLaunchingNew

Gets or sets the observable which signals when the application is launching new. This can happen when an app has recently crashed, as well as the first time the app has been launched. Apps should create their state from scratch.

IObservable<Unit> IsLaunchingNew { get; set; }

Property Value

IObservable<Unit>

IsResuming

Gets or sets the observable which signals when the application is resuming from suspended state (i.e. it was previously running but its process was destroyed).

IObservable<Unit> IsResuming { get; set; }

Property Value

IObservable<Unit>

IsUnpausing

Gets or sets the observable which signals when the application is activated. Note that this may mean that your process was not actively running before this signal.

IObservable<Unit> IsUnpausing { get; set; }

Property Value

IObservable<Unit>

ShouldInvalidateState

Gets or sets the observable which signals that the saved application state should be deleted, this usually is called after an app has crashed.

IObservable<Unit> ShouldInvalidateState { get; set; }

Property Value

IObservable<Unit>

ShouldPersistState

Gets or sets the observable which signals when the application should persist its state to disk.

IObservable<IDisposable> ShouldPersistState { get; set; }

Property Value

IObservable<IDisposable>

Returns an IDisposable that should be disposed once the application finishes persisting its state.