Exemplo n.º 1
0
 private void WindowVisibilityChanged(System.Object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
 {
     App.InitializeInstance();
     LoggingService.LogInfo($"[{nameof(NotepadsMainPage)}] Window Visibility Changed, Visible = {e.Visible}.", consoleOnly: true);
     // Perform operations that should take place when the application becomes visible rather than
     // when it is prelaunched, such as building a what's new feed
 }
Exemplo n.º 2
0
 async void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
 {
     if (e.Visible)
     {
         await UpdateDialog();
     }
 }
Exemplo n.º 3
0
 private void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
 {
     if (Window.Current.Visible)
     {
         canvasControl.Invalidate();
     }
 }
        async void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
        {
            if (e.Visible)
            {
                // バックグラウンドからフォラグラウンドに切り替わった

                await RestartPreviewAsync();
            }
        }
Exemplo n.º 5
0
        private async void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
        {
            if (e.Visible)
            {
                await this.OnAppVisible();
            }

            this.LoadResources();
        }
Exemplo n.º 6
0
        /// <summary>
        ///  Perform operations that should take place when the application becomes visible rather than
        ///  when it is prelaunched, such as building a what's new feed
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        static void WindowVisibilityChangedEventHandler(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
        {
            if (!e.Visible)   // app losing focus
            {
                return;
            }

            TodayController.CheckHeroQuote();
        }
Exemplo n.º 7
0
        private void OnWindowVisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
        {
            Frame frame = Window.Current.Content as Frame;
            IWindowVisibilityWatcher watcher = frame.Content as IWindowVisibilityWatcher;

            if (watcher != null)
            {
                watcher.OnVisibilityChanged(e.Visible);
            }
        }
Exemplo n.º 8
0
 private void OnWindowVisibilityChanged(Object sender, Windows.UI.Core.VisibilityChangedEventArgs args)
 {
     if (!args.Visible)
     {
         OnDiactivating();
     }
     else
     {
         OnActivating();
     }
 }
Exemplo n.º 9
0
 private void WindowVisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
 {
     if (e.Visible && !_onlineTimer.IsEnabled)
     {
         _onlineTimer.Start();
     }
     else if (!e.Visible && _onlineTimer.IsEnabled)
     {
         _onlineTimer.Stop();
     }
 }
Exemplo n.º 10
0
 private void OnVisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs args)
 {
     if (args.Visible && mRenderSurface != EGL.NO_SURFACE)
     {
         StartRenderLoop();
     }
     else
     {
         StopRenderLoop();
     }
 }
 /// <summary>
 ///  <c>CoreWindow</c>の可視状態が変わった時のイベント処理.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 async void CoreWindow_Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
 {
     // 小細工
     if (this.wasSavedState && e.Visible)
     {
         this.wasSavedState = false;
         LoadCurrentLockscreenImageAsync();
         DoUpdateOnAppLaunchAsync();
         await TileHelper.CleanupUnusedTileIdsAsync();
     }
 }
 void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
 {
     if (e.Visible)
     {
         //  App en primer plano
     }
     else
     {
         //  App en segundo plano
     }
 }
Exemplo n.º 13
0
 async void core_VisibilityChanged(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.VisibilityChangedEventArgs args)
 {
     if (args.Visible)
     {
         await StartMediaCapture();
     }
     else
     {
         await StopMediaCapture();
     }
 }
Exemplo n.º 14
0
 private void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
 {
     if (e.Visible)
     {
         WhirlPoolAPIClient.ClearToast();
         if (WhirlPoolAPIClient.APIKey == "")
         {
             ShowConfig();
         }
     }
 }
Exemplo n.º 15
0
 void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
 {
     if (e.Visible)
     {
         Page_GotFocus_1(new object(), new RoutedEventArgs());
     }
     else
     {
         Page_LostFocus_1(new object(), new RoutedEventArgs());
     }
 }
Exemplo n.º 16
0
 void OnVisibilityChanged(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.VisibilityChangedEventArgs args)
 {
     if (args.Visible && _renderSurface != IntPtr.Zero)
     {
         StartRenderLoop();
     }
     else
     {
         StopRenderLoop();
     }
 }
Exemplo n.º 17
0
        private async void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
        {
            if (e.Visible && _initialized)
            {
                await Initialize();
            }
            else if (!e.Visible && _initialized)
            {
                await CleanUp();

                _initialized = true;
            }
        }
        void OnVisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
        {
            Debug.WriteLine(DebugTag + "OnVisibilityChanged(): " + e.Visible);

            if (e.Visible && !_pickingFile)
            {
                InitializeCameraAsync();
            }
            else
            {
                StopCameraAsync();
            }
        }
Exemplo n.º 19
0
 private void OnWindowVisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
 {
     if (_mediaPlayer != null)
     {
         if (e.Visible)
         {
             _mediaPlayer.MediaPlayer.Play();
         }
         else
         {
             _mediaPlayer.MediaPlayer.Pause();
         }
     }
 }
 // important because the UWP camera stream automatically shuts down when a window is minimized
 private async void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs args)
 {
     if (args.Visible == false)
     {
         if (_anylineScanView != null)
         {
             await _anylineScanView.StopCameraAsync();
         }
     }
     if (args.Visible == true)
     {
         _anylineScanView?.StartCamera();
     }
 }
Exemplo n.º 21
0
        private void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
        {
            if (_contentProvider is null)
            {
                return;
            }

            if (e.Visible)
            {
                Resume();
            }
            else
            {
                Pause();
            }
        }
Exemplo n.º 22
0
        /// <summary>
        /// maintains the app's visual state when the screen is locked
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private async void CurrentWindow_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
        {
            if (onRecogPage.Equals(true))
            {
                if (e.Visible && isLocked == true)
                {
                    await UpdateResult();

                    isLocked = false;
                }
                else
                {
                    isLocked = true;
                }
            }
        }
Exemplo n.º 23
0
 private void CheckIfAppIsSuspended(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
 {
     if (Window.Current.Visible == true)
     {
         if (ApplicationApplicationState != Enums.ApplicationStateType.Active)
         {
             ApplicationApplicationState = Enums.ApplicationStateType.Active;
         }
     }
     else
     {
         if (ApplicationApplicationState != Enums.ApplicationStateType.Suspended)
         {
             ApplicationApplicationState = Enums.ApplicationStateType.Suspended;
         }
     }
 }
Exemplo n.º 24
0
 /// <summary>
 /// Toggles on and off the camera when app loses/gains visibility on the screen
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private async void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
 {
     try
     {
         if (e.Visible)
         {
             await defaultViewModel.ResumePreviewAsync();
         }
         else
         {
             await defaultViewModel.PausePreviewAsync();
         }
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine(ex.Message);
     }
 }
 async void Window_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
 {
     if (!e.Visible)
     {
         await CleanupAsync();
     }
     else
     {
         try
         {
             await InitializeAsync();
         }
         catch (Exception err)
         {
             rootPage.NotifyUser("Camera initialization error: " + err.Message + "\n Try restarting the sample.", NotifyType.ErrorMessage);
         }
     }
 }
Exemplo n.º 26
0
        private void Window_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
        {
            if (!(AssociatedObject is Image image) ||
                !(image.Source is BitmapImage bitmap) ||
                !bitmap.IsAnimatedBitmap)
            {
                return;
            }

            if (e.Visible)
            {
                bitmap.Play();
            }
            else
            {
                bitmap.Stop();
            }
        }
Exemplo n.º 27
0
 void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
 {
     if (e.Visible)
     {
         Frame rootFrame = Window.Current.Content as Frame;
         // if we are not on the logon page then we should check if the secure store locked itself
         if (rootFrame.CurrentSourcePageType != typeof(LogonPage))
         {
             if (Globals.LogonCore != null)
             {
                 if (!Globals.LogonCore.State.IsSecureStoreOpen)
                 {
                     RegistrationHelper.NavigateToLogonPage(rootFrame);
                 }
             }
         }
     }
 }
Exemplo n.º 28
0
        void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
        {
            if (e.Visible)
            {
                AppDatabase.Current.LoadInstances();
                //_startAll();

                NavigationService.NavigateOnUI("FlickrLoginView");
            }
            else
            {
                AppDatabase.Current.Unload();
                RenderingService.Unload();
                _stopAll();

                NavigationService.NavigateOnUI("SuspendedView");
            }
        }
Exemplo n.º 29
0
        private void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
        {
            if (e.Visible)
            {
                if (RecentlyPlayed)
                {
                    this.AssociatedObject.Play();
                    RecentlyPlayed = false;
                }
            }
            else
            {
                RecentlyPlayed = AssociatedObject.CurrentState == Windows.UI.Xaml.Media.MediaElementState.Playing ||
                                 AssociatedObject.CurrentState == Windows.UI.Xaml.Media.MediaElementState.Opening ||
                                 AssociatedObject.CurrentState == Windows.UI.Xaml.Media.MediaElementState.Buffering;

                if (this.AssociatedObject.CanPause)
                {
                    this.AssociatedObject.Pause();
                }
            }
        }
Exemplo n.º 30
0
        void OnWindowVisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
        {
            Window w = sender as Window;

            if (w != null)
            {
                Frame f = w.Content as Frame;
                if (f != null)
                {
                    MainPage main = f.Content as MainPage;
                    if (main != null)
                    {
                        if (e.Visible)
                        {
                            main.Reconnect();
                        }
                        else
                        {
                            main.Disconnect();
                        }
                    }
                }
            }
        }