Skip to content

AutoSuspendHelper class

Defined in

Namespace: ReactiveUI.XamForms Assembly: ReactiveUI.XamForms.dll Full name: ReactiveUI.XamForms.AutoSuspendHelper Modifiers: public

Summary

View source

         Helps manage Xamarin.Forms application lifecycle events.
         

Applies to

netstandard2.0

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

Implements: IEnableLogger, IDisposable

Remarks

Instantiate this class in order to setup ReactiveUI suspension hooks. Sample usage of AutoSuspendHelper is given by the code snippet below.

<![CDATA[
 public partial class App : Application
 {
 private readonly AutoSuspendHelper _autoSuspendHelper;
 
 public App()
 {
 _autoSuspendHelper = new AutoSuspendHelper();
 RxApp.SuspensionHost.CreateNewAppState = () => new MainState();
 RxApp.SuspensionHost.SetupDefaultSuspendResume(new CustomSuspensionDriver());
 _autoSuspendHelper.OnCreate();
 
 InitializeComponent();
 MainPage = new MainView();
 }
 
 protected override void OnStart() => _autoSuspendHelper.OnStart();
 
 protected override void OnResume() => _autoSuspendHelper.OnResume();
 
 protected override void OnSleep() => _autoSuspendHelper.OnSleep();
 }
 ]]>

Constructors

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

Properties

NameSummary
static UntimelyDemiseGets a subject to indicate whether the application has crashed.

Methods

NameSummary
OnCreateCall this method in the constructor of your Xamarin.Forms Application.
OnStartCall this method in OnStart method override in your Xamarin.Forms Application.
OnSleepCall this method in OnSleep method override in your Xamarin.Forms Application.
OnResumeCall this method in OnResume method override in your Xamarin.Forms Application.
Dispose
Inherited members