Inheritance: IVisibilityChangedEventArgs, ICoreWindowEventArgs
コード例 #1
0
 private void OnVisibilityChanged(CoreWindow sender, VisibilityChangedEventArgs args)
 {
     if (args.Visible == false)
         SystemNavigationManager.GetForCurrentView().BackRequested -= BackButtonPressed;
     else
     {
         SystemNavigationManager.GetForCurrentView().BackRequested += BackButtonPressed;
     }
 }
コード例 #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;
     }
 }
コード例 #3
0
 private void VisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
     if (ScenarioEnableButton.IsEnabled)
     {
         if (e.Visible)
             Enable();
         else
             Disable();
     }
 }
コード例 #4
0
 private void OnVisibilityChanged(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.VisibilityChangedEventArgs args)
 {
     if (args.Visible && mRenderSurface != EGL.NO_SURFACE)
     {
         StartRenderLoop();
     }
     else
     {
         StopRenderLoop();
     }
 }
コード例 #5
0
 void Current_VisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
     if (!e.Visible)
     {
         
     }
     else
     {
         
     }
 }
        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;
            }
        }
コード例 #7
0
 void Current_VisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
     if (!e.Visible)
     {
         DisposeCaptureAsync();
     }
     else
     {
         PrepareCameraView();
     }
 }
コード例 #8
0
        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();
            }
        }
コード例 #9
0
 void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
 {
     Window.Current.VisibilityChanged -= Current_VisibilityChanged;
     rootFrame = Window.Current.Content as Frame;
     if (rootFrame != null)
     {
         SubscribeEvents();
     }
     else if (Window.Current.Content != null)
     {
         ErrorRootIsNotFrame();
     }
 }
コード例 #10
0
ファイル: SlideShow.cs プロジェクト: ridomin/waslibs
 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);
         }
     }
 }
コード例 #11
0
ファイル: Scenario2.xaml.cs プロジェクト: ckc/WinApp
 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;
         }
     }
 }
コード例 #12
0
ファイル: SensorWindow.xaml.cs プロジェクト: Al87/Robot
        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);
            }
        }
コード例 #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 (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();
         }
     }
 }
コード例 #14
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 += Shaken;
         }
         else
         {
             // Disable sensor input
             _accelerometer.Shaken -= Shaken;
         }
     }
 }
コード例 #15
0
ファイル: Scenario2.xaml.cs プロジェクト: mbin/Win81App
 /// <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 (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);
         }
     }
 }
 /// <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;
         }
     }
 }
コード例 #18
0
 private async void Current_VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
 {
     try
     {
         if (e.Visible)
         {
             await ResumePreviewAsync();
         }
         else
         {
             await PausePreviewAsync();
         }
     }
     catch (Exception ex)
     {
         System.Diagnostics.Debug.WriteLine(ex.Message);
     }
 }
コード例 #19
0
 void WindowVisibilityChangedEventHandler(System.Object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
 {
     Task.Factory.StartNew(async() =>
     {
         try
         {
             string json = await HttpRequest.HttpRequst.MainPageRequest(1, "C402758D1A773C4C70F160A11C1172E1");
             if (!string.IsNullOrWhiteSpace(json))
             {
                 getVideoModel = JsonConvert.DeserializeObject <Model.VideoModel>(json);
             }
             viewmodel.VideoModel = getVideoModel;
         }
         catch (Exception)
         {
         }
     });
     Task.Delay(1000);
 }
コード例 #20
0
        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();
            }
        }
コード例 #21
0
 async void Current_VisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
     if (e.Visible)
     {
         await InitializeCaptureAsync();
     }
     else
     {
         await DisposeCaptureAsync();
     }
 }
コード例 #22
0
        /// <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();
                }
            }
        }
コード例 #23
0
 private void CoreVisibilityChanged(CoreWindow sender, VisibilityChangedEventArgs args)
 {
     if (args.Visible)
     {
         PincodeManager.TriggerBackgroundedPinTimer();
         TokenRefresher.Start();
     }
     else
     {
         PincodeManager.SavePinTimer();
         TokenRefresher.Stop();
     }
 }
コード例 #24
0
 void IWindowEventSink.OnVisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
 }
コード例 #25
0
 private async void CoreWindowVisibilityChanged(CoreWindow sender, VisibilityChangedEventArgs args)
 {
     if (args.Visible)
         return;
     await EndDraggingAsync();
 }
コード例 #26
0
 private void VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
 {
     canvas.Paused = !e.Visible;
 }
コード例 #27
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
            }
        }
コード例 #28
0
        private async void OnWindowVisibilityChanged(object sender, VisibilityChangedEventArgs e) {
            if (e.Visible)
            {
                StartPreview();
            }
            else 
            {
                await cameraCapture.stop();

                StopPreview();
            }
        }
コード例 #29
0
ファイル: NhayDay.xaml.cs プロジェクト: dracudakid/AppGiamCan
 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);
         }
     }
 }
コード例 #30
0
ファイル: InputEvents.cs プロジェクト: BrainSlugs83/MonoGame
 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();
 }
コード例 #31
0
 private void Window_VisibilityChanged(CoreWindow sender, Windows.UI.Core.VisibilityChangedEventArgs args)
 {
     this.VisibilityChanged?.Invoke(this, new GameFramework.Abstractions.VisibilityChangedEventArgs(args.Visible));
 }
コード例 #32
0
ファイル: MainPage.xaml.cs プロジェクト: hmcaio/UnityPorting
        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);
               
            }

        }
コード例 #33
0
ファイル: Frame.cs プロジェクト: fstn/WindowsPhoneApps
		private void OnVisibilityChanged(object sender, VisibilityChangedEventArgs args)
		{
			if (CurrentPage != null)
				CurrentPage.GetPage(this).OnVisibilityChanged(args);
		}
コード例 #34
0
 private void CoreWindow_VisibilityChanged(CoreWindow sender, VisibilityChangedEventArgs args)
 {
     try
     {
         if (args.Visible)
             ClearMessageCount();
     }
     catch (Exception uiEx) { Frontend.UIError(uiEx); }
 }
コード例 #35
0
ファイル: Adjust.cs プロジェクト: adjust/windows_sdk
 /// <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();
     }
 }
コード例 #36
0
ファイル: MainPage.xaml.cs プロジェクト: randyammar/Notepads
 void WindowVisibilityChangedEventHandler(System.Object sender, Windows.UI.Core.VisibilityChangedEventArgs e)
 {
     // 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
 }
コード例 #37
0
 private void Window_VisibilityChanged(object sender, VisibilityChangedEventArgs e)
 {
     if (e.Visible)
     {
         _gifPresenter?.StartAnimation();
     }
     else if (!e.Visible)
     {
         _gifPresenter?.StopAnimation(); // Prevent unnecessary work
     }
 }