private void OnLeavingBackground(object sender, LeavingBackgroundEventArgs e)
        {
            Debug.WriteLine("Leaving Background: " + e);
            Deferral deferral = e.GetDeferral();

            deferral.Complete();
        }
Exemplo n.º 2
0
        private void App_LeavingBackground(object sender, LeavingBackgroundEventArgs e)
        {
            var deferral = e.GetDeferral();

            BLogger.Logger.Info("App left background and is now in foreground...");
            deferral.Complete();
        }
Exemplo n.º 3
0
 public async void Resume(object sender, LeavingBackgroundEventArgs e)
 {
     using (var deferral = e.GetDeferral())
     {
         await ResumeCore();
     }
 }
Exemplo n.º 4
0
        private void OnLeavingBackground(object sender, LeavingBackgroundEventArgs e)
        {
            Deferral deferral = e.GetDeferral();

            IsForeground = true;
            NotificationSystem.RemoveCallToastNotifications();
            deferral.Complete();
        }
Exemplo n.º 5
0
        private void App_LeavingBackground(object sender, LeavingBackgroundEventArgs e)
        {
            var deferral = e.GetDeferral();

            CoreWindowLogic.EnableDisableSmtc();
            CoreWindowLogic.isBackground = false;
            deferral.Complete();
        }
Exemplo n.º 6
0
        private void App_OnLeavingBackground(object sender, LeavingBackgroundEventArgs e)
        {
            var def = e.GetDeferral();

#if LIFECYCLE_EVENTS
            MessageService.DisplayToastMessage(_lifecycleEventCount++ + " LEAVING BACKGROUND");
#endif
            def.Complete();
        }
        private async void Current_LeavingBackground(object sender, LeavingBackgroundEventArgs e)
        {
            if (Frame.CurrentSourcePageType == typeof(CameraPage))
            {
                var deferral = e.GetDeferral();
                await StartPreviewAsync();

                deferral.Complete();
            }
        }
Exemplo n.º 8
0
        protected virtual async void OnLeavingBackground(object sender, LeavingBackgroundEventArgs e)
        {
            var deferral = e.GetDeferral();

            try
            {
                var suspension = Mvx.IoCProvider.GetSingleton <IMvxSuspensionManager>();
                await LeaveBackground(suspension);
            }
            finally
            {
                deferral.Complete();
            }
        }
Exemplo n.º 9
0
        private void App_LeavingBackground(object sender, LeavingBackgroundEventArgs e)
        {
            var deferral = e.GetDeferral();

            if (!firsttime)
            {
                CoreWindowLogic.EnableDisableSmtc();
            }
            else
            {
                firsttime = false;
            }
            CoreWindowLogic.isBackground = false;
            BLogger.Logger.Info("App left background and is now in foreground...");
            deferral.Complete();
        }
Exemplo n.º 10
0
        protected virtual async void OnLeavingBackground(object sender, LeavingBackgroundEventArgs e)
        {
            if (e == null)
            {
                throw new NullReferenceException(nameof(e));
            }

            var deferral = e.GetDeferral();

            try
            {
                var suspension = Mvx.IoCProvider.GetSingleton <IMvxSuspensionManager>();
                await LeaveBackground(suspension).ConfigureAwait(false);
            }
            finally
            {
                deferral.Complete();
            }
        }
Exemplo n.º 11
0
        private async void App_LeavingBackground(object sender, LeavingBackgroundEventArgs e)
        {
            var d = e.GetDeferral();

            if (Window.Current.Content is AppShell shell && shell.AppFrame.CanGoBack)
            {
                try
                {
                    await SuspensionManager.RestoreAsync();
                }
                catch (SuspensionManagerException ex)
                {
                    // Something went wrong restoring state.
                    // Assume there is no state and continue
                }
            }


            d.Complete();
        }
Exemplo n.º 12
0
        private async void OnLeavingBackground(object sender, LeavingBackgroundEventArgs e)
        {
            var deferral = e.GetDeferral();

            try
            {
                if (MainPage.Current?.RealtimeClient != null)
                {
                    MainPage.Current.RealtimeClient.AppIsInBackground = false;
                    await MainPage.Current.RealtimeClient.StartFresh();
                }
            }
            catch (Exception exception)
            {
                exception.PrintException("OnLeavingBackground");
            }
            finally
            {
                deferral.Complete();
            }
        }
Exemplo n.º 13
0
        private async void CoreApplication_LeavingBackground(object sender, LeavingBackgroundEventArgs e)
        {
            var Deferral = e.GetDeferral();

            if (ApplicationData.Current.LocalSettings.Values["LastSelectedCameraSource"] is string LastSelectedCameraSource)
            {
                var MediaFraSourceGroup = await MediaFrameSourceGroup.FindAllAsync();

                foreach (var FrameSource in from MediaFrameSourceGroup FrameSource in MediaFraSourceGroup
                         where FrameSource.DisplayName == LastSelectedCameraSource
                         select FrameSource)
                {
                    CaptureControl.Source = Capture = await MediaCaptureProvider.SetFrameSourceAndInitializeCaptureAsync(FrameSource);

                    break;
                }
            }
            else
            {
                CaptureControl.Source = Capture = await MediaCaptureProvider.SetFrameSourceAndInitializeCaptureAsync();
            }

            ApplicationData.Current.LocalSettings.Values["ReturnCosmeticsEffectExcution"] = true;
            VideoEffectDefinition EffectDefinition = new VideoEffectDefinition("CosmeticsEffect.CosmeticsVideoEffect");

            ApplicationData.Current.LocalSettings.Values["ReturnCosmeticsEffectExcution"] = false;
            VideoEffect = await Capture.AddVideoEffectAsync(EffectDefinition, MediaStreamType.VideoPreview);

            CaptureControl.Source = Capture;
            await Capture.StartPreviewAsync();

            VideoEffect.SetProperties(new PropertySet()
            {
                { "LipColor", (CosmeticsControl.SelectedItem as CosmeticsItem).LipColor }
            });
            StayAwake.RequestActive();

            Deferral.Complete();
        }
Exemplo n.º 14
0
        private void OnLeavingBackground(object sender, LeavingBackgroundEventArgs e)
        {
            Deferral deferral = e.GetDeferral();

            deferral.Complete();
        }