private void RegisterHostLifecycleEventHandlers() { HostLifecycleService.Suspending += Suspending; HostLifecycleService.Resuming += Resuming; HostLifecycleService.AddRef(); }