private void OnVisibilityChanged(CoreWindow sender, VisibilityChangedEventArgs args) { if (args.Visible == false) SystemNavigationManager.GetForCurrentView().BackRequested -= BackButtonPressed; else { SystemNavigationManager.GetForCurrentView().BackRequested += BackButtonPressed; } }
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; } }
private void VisibilityChanged(object sender, VisibilityChangedEventArgs e) { if (ScenarioEnableButton.IsEnabled) { if (e.Visible) Enable(); else Disable(); } }
private void OnVisibilityChanged(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.VisibilityChangedEventArgs args) { if (args.Visible && mRenderSurface != EGL.NO_SURFACE) { StartRenderLoop(); } else { StopRenderLoop(); } }
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; } }
void Current_VisibilityChanged(object sender, VisibilityChangedEventArgs e) { if (!e.Visible) { DisposeCaptureAsync(); } else { PrepareCameraView(); } }
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(); } }
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(); } }
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); } } }
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; } } }
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) _dispatcherTimer.Start(); } else { // Disable sensor input (no need to restore the default reportInterval... resources will be released upon app suspension) _dispatcherTimer.Stop(); } } }
/// <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 _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; } } }
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); } }
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); }
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(); } }
async void Current_VisibilityChanged(object sender, VisibilityChangedEventArgs e) { if (e.Visible) { await InitializeCaptureAsync(); } else { await DisposeCaptureAsync(); } }
/// <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(); } } }
private void CoreVisibilityChanged(CoreWindow sender, VisibilityChangedEventArgs args) { if (args.Visible) { PincodeManager.TriggerBackgroundedPinTimer(); TokenRefresher.Start(); } else { PincodeManager.SavePinTimer(); TokenRefresher.Stop(); } }
void IWindowEventSink.OnVisibilityChanged(object sender, VisibilityChangedEventArgs e) { }
private async void CoreWindowVisibilityChanged(CoreWindow sender, VisibilityChangedEventArgs args) { if (args.Visible) return; await EndDraggingAsync(); }
private void VisibilityChanged(object sender, Windows.UI.Core.VisibilityChangedEventArgs e) { canvas.Paused = !e.Visible; }
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 } }
private async void OnWindowVisibilityChanged(object sender, VisibilityChangedEventArgs e) { if (e.Visible) { StartPreview(); } else { await cameraCapture.stop(); StopPreview(); } }
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); } } }
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 void Window_VisibilityChanged(CoreWindow sender, Windows.UI.Core.VisibilityChangedEventArgs args) { this.VisibilityChanged?.Invoke(this, new GameFramework.Abstractions.VisibilityChangedEventArgs(args.Visible)); }
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); } }
private void OnVisibilityChanged(object sender, VisibilityChangedEventArgs args) { if (CurrentPage != null) CurrentPage.GetPage(this).OnVisibilityChanged(args); }
private void CoreWindow_VisibilityChanged(CoreWindow sender, VisibilityChangedEventArgs args) { try { if (args.Visible) ClearMessageCount(); } catch (Exception uiEx) { Frontend.UIError(uiEx); } }
/// <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(); } }
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 }
private void Window_VisibilityChanged(object sender, VisibilityChangedEventArgs e) { if (e.Visible) { _gifPresenter?.StartAnimation(); } else if (!e.Visible) { _gifPresenter?.StopAnimation(); // Prevent unnecessary work } }