Inheritance: IVisibilityChangedEventArgs, ICoreWindowEventArgs
Ejemplo n.º 1
0
 private void OnVisibilityChanged(CoreWindow sender, VisibilityChangedEventArgs args)
 {
     if (args.Visible == false)
         SystemNavigationManager.GetForCurrentView().BackRequested -= BackButtonPressed;
     else
     {
         SystemNavigationManager.GetForCurrentView().BackRequested += BackButtonPressed;
     }
 }
Ejemplo n.º 2
0
 private void MainPage_VisibilityChanged(CoreWindow sender, VisibilityChangedEventArgs args)
 {
     if (args.Visible == false)
     {
         //whenever we move away from the page, save data. 
         App.PageData = txtDataToBeSaved.Text;
         App.UseCloudStorage = chkSaveToCloud.IsChecked.Value;
         App.ExtendedExecution = chkEnableExtension.IsChecked.Value;
     }
 }
Ejemplo n.º 3
0
 private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
     if (ScenarioEnableButton.IsEnabled)
     {
         if (e.Visible)
             Enable();
         else
             Disable();
     }
 }
 void Current_VisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
     if (!e.Visible)
     {
         
     }
     else
     {
         
     }
 }
 void Current_VisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
     if (!e.Visible)
     {
         DisposeCaptureAsync();
     }
     else
     {
         PrepareCameraView();
     }
 }
        private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
        {

            if (e.Visible)
            {
                // A view is consolidated with other views hen there's no way for the user to get to it (it's not in the list of recently used apps, cannot be
                // launched from Start, etc.) A view stops being consolidated when it's visible--at that point the user can interact with it, move it on or off screen, etc. 
                // It's generally a good idea to close a view after it has been consolidated, but keep it open while it's visible.
                Consolidated = false;
            }
        }
        private async void Window_VisibilityChanged(object sender, VisibilityChangedEventArgs e)
        {
            // Since a registration can change from ForegroundOverride to Disabled when the device
            // is locked, update the registrations when the app window becomes visible
            if (e.Visible && isHceSupported)
            {
                // Clear the messages
                rootPage.NotifyUser(String.Empty, NotifyType.StatusMessage, true);

                lstCards.ItemsSource = await SmartCardEmulator.GetAppletIdGroupRegistrationsAsync();
            }
        }
Ejemplo n.º 8
0
 private void OnVisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
     if (_delayStoryboard != null)
     {
         if (e.Visible)
         {
             var back = _container.Children[0] as Control;
             var fore = _container.Children[1] as Control;
             _container.Children.Clear();
             _container.Children.Add(back);
             _container.Children.Add(fore);
         }
     }
 }
 /// <summary>
 /// This is the event handler for VisibilityChanged events. You would register for these notifications
 /// if handling sensor data when the app is not visible could cause unintended actions in the app.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e">
 /// Event data that can be examined for the current visibility state.
 /// </param>
 private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
     if (ScenarioDisableButton.IsEnabled)
     {
         if (e.Visible)
         {
             // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
             accelerometer.ReadingChanged += ReadingChanged;
         }
         else
         {
             // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
             accelerometer.ReadingChanged -= ReadingChanged;
         }
     }
 }
Ejemplo n.º 10
0
 private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
     if (Animating)
     {
         if (!e.Visible)
         {
             // Stop updating since you can't render to a SurfaceImageSource when the window isn't visible
             CompositionTarget.Rendering -= AdvanceAnimation;
         }
         else
         {
             // Restart rendering
             CompositionTarget.Rendering += AdvanceAnimation;
         }
     }
 }
Ejemplo n.º 11
0
        private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
        {

            if (e.Visible)
            {
                // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
                _accelerometer.ReadingChanged +=
                    new TypedEventHandler<Accelerometer, AccelerometerReadingChangedEventArgs>(ReadingChanged);
            }
            else
            {
                // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
                _accelerometer.ReadingChanged -=
                    new TypedEventHandler<Accelerometer, AccelerometerReadingChangedEventArgs>(ReadingChanged);
            }
        }
 /// <summary>
 /// This is the event handler for VisibilityChanged events. You would register for these notifications
 /// if handling sensor data when the app is not visible could cause unintended actions in the app.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e">
 /// Event data that can be examined for the current visibility state.
 /// </param>
 private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
     if (ScenarioDisableButton.IsEnabled)
     {
         if (e.Visible)
         {
             // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
             _sensor.OrientationChanged += new TypedEventHandler<SimpleOrientationSensor, SimpleOrientationSensorOrientationChangedEventArgs>(OrientationChanged);
         }
         else
         {
             // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
             _sensor.OrientationChanged -= new TypedEventHandler<SimpleOrientationSensor, SimpleOrientationSensorOrientationChangedEventArgs>(OrientationChanged);
         }
     }
 }
Ejemplo n.º 13
0
 /// <summary>
 /// This is the event handler for VisibilityChanged events. You would register for these notifications
 /// if handling sensor data when the app is not visible could cause unintended actions in the app.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e">
 /// Event data that can be examined for the current visibility state.
 /// </param>
 private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
     if (ScenarioDisableButton.IsEnabled)
     {
         if (e.Visible)
         {
             // Re-enable sensor input
             _accelerometer.Shaken += new TypedEventHandler<Accelerometer, AccelerometerShakenEventArgs>(Shaken);
         }
         else
         {
             // Disable sensor input
             _accelerometer.Shaken -= new TypedEventHandler<Accelerometer, AccelerometerShakenEventArgs>(Shaken);
         }
     }
 }
 /// <summary>
 /// This is the event handler for VisibilityChanged events. You would register for these notifications
 /// if handling sensor data when the app is not visible could cause unintended actions in the app.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e">
 /// Event data that can be examined for the current visibility state.
 /// </param>
 private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
     if (ScenarioDisableButton.IsEnabled)
     {
         if (e.Visible)
         {
             // Re-enable sensor input
             _accelerometer.Shaken += Shaken;
         }
         else
         {
             // Disable sensor input
             _accelerometer.Shaken -= Shaken;
         }
     }
 }
 /// <summary>
 /// This is the event handler for VisibilityChanged events. You would register for these notifications
 /// if handling sensor data when the app is not visible could cause unintended actions in the app.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e">
 /// Event data that can be examined for the current visibility state.
 /// </param>
 private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
     if (ScenarioDisableButton.IsEnabled)
     {
         if (e.Visible)
         {
             // Re-enable sensor input (no need to restore the desired reportInterval... it is restored for us upon app resume)
             _dispatcherTimer.Start();
         }
         else
         {
             // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension)
             _dispatcherTimer.Stop();
         }
     }
 }
        void Current_VisibilityChanged(object sender, VisibilityChangedEventArgs e)
        {
            // Timeout the animation if the secondary window fails to respond in 500
            // ms. Since this animation clears out the main view of the app, it's not desirable
            // to leave it unusable
            if (e.Visible || (DateTime.Now - lastFadeOutTime).TotalMilliseconds > TIMEOUT_LENGTH)
            {

                // This event always fires on the UI thread, along with Fade_Completed,
                // so there is no race condition with the two methods both changing this
                // value
                if (animationTask != null)
                {
                    animationTask.TrySetCanceled();
                    animationTask = null;
                }
                fadeOutStoryboard.Stop();
            }
        }
        /// <summary>
        /// This is the event handler for VisibilityChanged events.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e">
        /// Event data that can be examined for the current visibility state.
        /// </param>
        private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
        {
            if (ScenarioDisableButton.IsEnabled)
            {
                ApplicationData.Current.LocalSettings.Values["IsAppVisible"] = e.Visible;

                if (e.Visible)
                {
                    _refreshTimer.Start();
                }
                else
                {
                    _refreshTimer.Stop();
                }
            }
        }
Ejemplo n.º 18
0
        private void OnWindowVisibilityChanged(object sender, VisibilityChangedEventArgs e)
        {
            if (!AppCallbacks.Instance.IsInitialized()) return;

            if (e.Visible)
            {
                AppCallbacks.Instance.InvokeOnAppThread(() =>
                {
                    GameManager.Instance.InitialiseSound();
                }, false);
                AppCallbacks.Instance.UnityPause(0);
                return;
            }
            else
            {
                AppCallbacks.Instance.UnityPause(1);

                var smallContent = TileContentFactory.CreateTileSquare150x150PeekImageAndText01();
                var wideContent = TileContentFactory.CreateTileWide310x150ImageAndText02();
                var largeContent = TileContentFactory.CreateTileSquare310x310ImageAndText01();

                AppCallbacks.Instance.InvokeOnAppThread(() =>
                {
                    var score = GameManager.Instance.GetScore();

                    AppCallbacks.Instance.InvokeOnUIThread(() =>
                    {
                        smallContent.Branding = TileBranding.None;
                        smallContent.TextHeading.Text = "Score : " + score.ToString();
                        smallContent.Image.Src = "ms-appx:///Assets/SquareTile.png";

                        wideContent.Branding = TileBranding.None; // Set this to TileBranding.Name if you wish to display your game name on the tile.
                        wideContent.TextCaption1.Text = "Score : " + score.ToString();
                        wideContent.Image.Src = "ms-appx:///Assets/WideLogo.png";
                        wideContent.RequireSquare150x150Content = false;

                        largeContent.Branding = TileBranding.None;
                        largeContent.Image.Src = "ms-appx:///Assets/SquareTile.png";
                        largeContent.TextCaptionWrap.Text = "Score : " + score.ToString();
                        largeContent.RequireWide310x150Content = false;
                        
                        var updaterWide = TileUpdateManager.CreateTileUpdaterForApplication();
                        updaterWide.Update(wideContent.CreateNotification());

                        var updaterLarge = TileUpdateManager.CreateTileUpdaterForApplication();
                        updaterLarge.Update(largeContent.CreateNotification());
                        //updater.Update(smallContent.CreateNotification());

                        
                    }, false);

                }, false);
               
            }

        }
Ejemplo n.º 19
0
 private void CoreWindow_VisibilityChanged(CoreWindow sender, VisibilityChangedEventArgs args)
 {
     //Forget about the held keys when we disappear as we don't receive key events for them while we are in the background
     if (!args.Visible)
         _keys.Clear();
 }
 private async void CoreWindowVisibilityChanged(CoreWindow sender, VisibilityChangedEventArgs args)
 {
     if (args.Visible)
         return;
     await EndDraggingAsync();
 }
 void IWindowEventSink.OnVisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
 }
Ejemplo n.º 22
0
        private async void OnWindowVisibilityChanged(object sender, VisibilityChangedEventArgs e) {
            if (e.Visible)
            {
                StartPreview();
            }
            else 
            {
                await cameraCapture.stop();

                StopPreview();
            }
        }
 private void CoreVisibilityChanged(CoreWindow sender, VisibilityChangedEventArgs args)
 {
     if (args.Visible)
     {
         PincodeManager.TriggerBackgroundedPinTimer();
         TokenRefresher.Start();
     }
     else
     {
         PincodeManager.SavePinTimer();
         TokenRefresher.Stop();
     }
 }
 private void Window_VisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
     if (e.Visible)
     {
         _gifPresenter?.StartAnimation();
     }
     else if (!e.Visible)
     {
         _gifPresenter?.StopAnimation(); // Prevent unnecessary work
     }
 }
Ejemplo n.º 25
0
 private void CoreWindow_VisibilityChanged(CoreWindow sender, VisibilityChangedEventArgs args)
 {
     try
     {
         if (args.Visible)
             ClearMessageCount();
     }
     catch (Exception uiEx) { Frontend.UIError(uiEx); }
 }
Ejemplo n.º 26
0
		private void OnVisibilityChanged(object sender, VisibilityChangedEventArgs args)
		{
			if (CurrentPage != null)
				CurrentPage.GetPage(this).OnVisibilityChanged(args);
		}
 async void Current_VisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
     if (e.Visible)
     {
         await InitializeCaptureAsync();
     }
     else
     {
         await DisposeCaptureAsync();
     }
 }
Ejemplo n.º 28
0
        private void OnCoreWindowVisibilityChanged(CoreWindow sender, VisibilityChangedEventArgs args)
        {
            // There are cases where pointer isn't getting released - this should hopefully end dragging too.
            if (!args.Visible)
            {
#pragma warning disable 4014
                this.EndDragging(null);
#pragma warning restore 4014
            }
        }
Ejemplo n.º 29
0
 /// <summary>
 ///  Tell Adjust that the application is activated (brought to foreground) or deactivated (sent to background).
 /// </summary>
 private static void VisibilityChanged(CoreWindow sender, VisibilityChangedEventArgs args)
 {
     if (firstVisibilityChanged)
     {
         firstVisibilityChanged = false;
         return;
     }
     if (args.Visible)
     {
         AdjustInstance.ApplicationActivated();
     }
     else
     {
         AdjustInstance.ApplicationDeactivated();
     }
 }
Ejemplo n.º 30
0
 private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
     if (ScenarioDisableButton.IsEnabled)
     {
         if (e.Visible)
         {
             _accelerometer.ReadingChanged += new TypedEventHandler<Accelerometer, AccelerometerReadingChangedEventArgs>(ReadingChanged);
         }
         else
         {
             _accelerometer.ReadingChanged -= new TypedEventHandler<Accelerometer, AccelerometerReadingChangedEventArgs>(ReadingChanged);
         }
     }
 }