AutoSuspendHelper class¶
Defined in
Namespace: ReactiveUI.XamForms
Assembly: ReactiveUI.XamForms.dll
Full name: ReactiveUI.XamForms.AutoSuspendHelper
Modifiers: public
Summary¶
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¶
| Name | Summary |
|---|---|
| .ctor | Initializes a new instance of the [AutoSuspendHelper](# class. |
Properties¶
| Name | Summary |
|---|---|
| static UntimelyDemise | Gets a subject to indicate whether the application has crashed. |
Methods¶
| Name | Summary |
|---|---|
| OnCreate | Call this method in the constructor of your Xamarin.Forms Application. |
| OnStart | Call this method in OnStart method override in your Xamarin.Forms Application. |
| OnSleep | Call this method in OnSleep method override in your Xamarin.Forms Application. |
| OnResume | Call this method in OnResume method override in your Xamarin.Forms Application. |
| Dispose |