protected override void OnSleep() { base.OnSleep(); AppStateContainer.GetInstance().IsAppActive = false; try { var storage = App.Current.Container.Resolve <Services.Storage.IStorageService>(); storage?.Suspend(); } catch (Exception ex) { _logger.LogError(ex, "Database suspension failed."); } }
protected override void OnResume() { base.OnResume(); AppStateContainer.GetInstance().IsAppActive = true; }