private async void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e) { Windows.Foundation.Deferral deferral = e.GetDeferral(); await ServiceLocator.Current.GetService <SuspendAndResumeService>().SaveStateAsync(); deferral.Complete(); }
private async void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e) { var deferral = e.GetDeferral(); await Singleton <SuspendAndResumeService> .Instance.SaveStateAsync(); deferral.Complete(); }
private void OnEnteredBackground(object sender, EnteredBackgroundEventArgs enteredBackgroundEventArgs) { if (ServiceProvider.IsInitialized) { ServiceProvider.EventAggregator.Publish(this, new BackgroundNavigationMessage()); } }
private async void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e) { var deferral = e.GetDeferral(); StateService.Instance.SaveStateAsync(); deferral.Complete(); }
private void AppEnteredBackground(object sender, EnteredBackgroundEventArgs e) { int[] size = new int[3]; size[0] = namesService.Count; size[1] = namesPubTopic.Count; size[2] = namesSubTopic.Count; // UnAdvertiseService for (int i = 0; i < size[0]; i++) { ServiceUnAdvertiser(namesService[i][0]); } // UnAdvertiseTopic for (int i = 0; i < size[1]; i++) { UnAdvertiser(namesPubTopic[i][0]); } // UnSubscribeTopic for (int i = 0; i < size[2]; i++) { UnSubscriber(namesSubTopic[i][0]); } Close(); }
private async void AppEnteredBackground(object sender, EnteredBackgroundEventArgs e) { await Dispatcher.RunAsync(CoreDispatcherPriority.Normal, () => { iErrorMessage.Text = "Application entered background"; }); }
// 不得在 EnteredBackground 事件中执行长时间运行的任务,因为这可能会导致用户感觉过渡到后台非常慢。 private void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e) { System.Diagnostics.Debug.WriteLine("EnteredBackground"); _isInBackgroundMode = true; MemoryManager.AppMemoryUsageIncreased += OnMemoryIncreased; MemoryManager.AppMemoryUsageLimitChanging += OnMemoryLimitChanged; }
private async void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e) { var deferral = e.GetDeferral(); await new FileIOService().saveData(); deferral.Complete(); }
public async void Suspend(object sender, EnteredBackgroundEventArgs e) { using (var deferral = e.GetDeferral()) { await SuspendCore(); } }
private void OnEnteredBackground(object sender, EnteredBackgroundEventArgs e) { Debug.WriteLine("Entering Background: " + e); Deferral deferral = e.GetDeferral(); deferral.Complete(); }
private void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e) { var deferral = e.GetDeferral(); CoreWindowLogic.Stringify(); deferral.Complete(); }
async void OnEnteringBackground(object sender, EnteredBackgroundEventArgs e) { // NB: getting rid of the UI here means that if the user opens up // N tabs then when they come back to the app those tabs will still // be there but will all start loading fresh again. That might not // be the best user experience as it loses their position on the // page. if (BrowserViewModel.ForegroundInstance != null) { var deferral = e.GetDeferral(); try { var serialized = BrowserViewModel.ForegroundInstance.Serialize(); await Storage.StoreAsync(serialized); } finally { deferral.Complete(); } } Window.Current.Content = null; this.background = true; }
/// <summary> /// The application entered the background. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e) { // Place the application into "background mode" and note the // transition with a flag. LogMessage("App Entered background"); isInBackgroundMode = true; }
private async void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e) { try { //GNARLY_TODO: Save the visual state. var frame = Window.Current.Content as Frame; var mainWindow = frame.Content as MainPage; if (mainWindow != null && mainWindow.ActiveChannel != null) { _cachedMessages = await mainWindow.ActiveChannel.DownloadMessages(MainPage.MaxMessageDownloadCount); } _appPreviouslyRunning = true; GnarlyClient.Instance.Disconnect(); } catch (TaskCanceledException) { CoreApplication.Exit(); } catch (OperationCanceledException) { CoreApplication.Exit(); } catch (HttpRequestException) { CoreApplication.Exit(); } catch (Exception exception) { ExceptionUploader.UploadException(exception.Message, exception.StackTrace); } // RegisterTask(BackgroundClientTask, BackgroundClientTaskEntryPoint); }
/// <summary> /// The application entered the background. /// </summary> private static void AppEnteredBackground(object sender, EnteredBackgroundEventArgs e) { // Send hit TelemetryService.Current.TrackEvent("Enter Background"); // Update the variable IsBackground = true; }
private void OnEnteredBackground(object sender, EnteredBackgroundEventArgs e) { var deferral = e.GetDeferral(); SaveApplicationState(); deferral.Complete(); }
private void OnEnteredBackground(object sender, EnteredBackgroundEventArgs e) { var deferral = e.GetDeferral(); //TODO: Save application state and stop any background activity deferral.Complete(); }
private void OnEnteredBackground(object sender, EnteredBackgroundEventArgs e) { Deferral deferral = e.GetDeferral(); IsForeground = false; NotificationSystem.RefreshCallNotification(CallSystem.CallManager.CurrentCalls); deferral.Complete(); }
private async void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e) { var deferral = e.GetDeferral(); await this.uaApplication.SuspendAsync(); deferral.Complete(); }
private void OnEnteredBackground(object sender, EnteredBackgroundEventArgs e) { ViewModel.NowPlayingTracks.Close(); PlaybackControl.Instance.NowPlayingChanged -= OnNowPlayingChanged; PlaybackControl.Instance.NowPlayingRestored -= OnNowPlayingRestored; PlaybackHistoryManager.Instance.NewEntryAdded -= OnNewHistoryEntryAdded; ViewModel.NowPlayingTracks.CollectionChanged -= OnUpcomingChanged; }
void OnEnteredBackground(object sender, EnteredBackgroundEventArgs e) { if (string.IsNullOrEmpty(billInput.Text)) { return; } ApplicationData.Current.LocalSettings.Values[nameof(App.SavedBillAmount)] = billInput.Text; }
/// <summary> /// Обработчик события перехода в фоновый режим /// </summary> /// <param name="sender">Источник события</param> /// <param name="e">Аргументы события перехода в фоновый режим</param> private async void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e) { // Получить отсрочку var deferral = e.GetDeferral(); // Сохранить состояние приложения await Helpers.Singleton<SuspendAndResumeService>.Instance.SaveStateAsync(); // Завершить отсрочку deferral.Complete(); }
private void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e) { var deferral = e.GetDeferral(); BLogger.Logger.Info("App has entered background..."); CoreWindowLogic.SaveSettings(); CoreWindowLogic.UpdateSmtc(); deferral.Complete(); }
private void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e) { if (!_isInBackgroundMode) { ShowToast("进入后台任务", "陈初静去休息一会"); } _isInBackgroundMode = true; }
private void OnEnteredBackground(object sender, EnteredBackgroundEventArgs enteredBackgroundEventArgs) { ApplicationSettingsHelper.SaveSettingsValue("AppBackgrounded", true); if (Locator.PlaybackService.PlayingType == PlayingType.Video && Locator.PlaybackService.IsPlaying) { Locator.PlaybackService.Pause(); } }
private void OnEnteredBackground(object sender, EnteredBackgroundEventArgs e) { if (IsTimerInProgress) { NotificationManager.Current.AddAllNotifications(IsInPomodoro, CurrentTimer.StartTime + CurrentTimer.TotalTime, SettingsService.Current.AutoStartOfNextPomodoro, SettingsService.Current.AutoStartOfBreak, _completedPomodoros, LongBreakAfter, PomodoroLength, ShortBreakLength, LongBreakLength); } }
private async void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e) { var Deferral = e.GetDeferral(); await ViewModelLocator.MainVM.EnteredBackground(); await Repository.GetObject <INavigationService>()?.SaveFrame(); Deferral.Complete(); }
public void HandleEnteredBackground(object sender, EnteredBackgroundEventArgs e) { LogThis(); _messengerService.Send(new Messages.EnteredBackgroundMessage { EventArgs = e }); _messengerService.Send(new Messages.AppVisibilityChangedMessage { Visibility = AppVisibilities.Background }); }
private async void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e) { var deferral = e.GetDeferral(); await SuspensionManager.SaveAsync(); deferral.Complete(); }
private async void Current_EnteredBackground(object sender, EnteredBackgroundEventArgs e) { if (Frame.CurrentSourcePageType == typeof(CameraPage)) { var deferral = e.GetDeferral(); await CleanupCameraAsync(); deferral.Complete(); } }
/// <summary> /// The application entered the background. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e) { // Place the application into "background mode" and note the // transition with a flag. Debug.WriteLine("Entered background"); isInBackgroundMode = true; // An application may wish to release views and view data // at this point since the UI is no longer visible. // // As a performance optimization, here we note instead that // the app has entered background mode with a boolean and // defer unloading views until AppMemoryUsageLimitChanging or // AppMemoryUsageIncreased is raised with an indication that // the application is under memory pressure. }
private void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e) { // 不要立即執行畫面的清除因爲有可能用戶會馬上回來 isInBackgroundMode = true; }
/// <summary> /// The application entered the background. /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void App_EnteredBackground(object sender, EnteredBackgroundEventArgs e) { // Place the application into "background mode" and note the // transition with a flag. ShowToast("Entered background"); isInBackgroundMode = true; // Unload view content if needed. // // If the AppMemoryUsageLevel changed and triggered AppMemoryUsageIncreased // before the app entered background mode then the view is still loaded // and we need to unload it now. UnloadViewContentIfNeeded(); }