Inheritance: IWindowActivatedEventArgs, ICoreWindowEventArgs
 void window_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         this.Hide();
     }
 }
 private void OnWindowActivated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == Windows.UI.Core.CoreWindowActivationState.Deactivated)
     {
         Close();
     }
 }
 private void Window_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.CodeActivated && _speechRecognizer.State == SpeechRecognizerState.Idle)
     {
         _ = _speechRecognizer.ContinuousRecognitionSession.StartAsync();
     }
 }
Beispiel #4
0
 private void OnWindowActivated(object sender, WindowsUI.Core.WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == WindowsUI.Core.CoreWindowActivationState.Deactivated)
     {
         this.popup.IsOpen = false;
     }
 }
Beispiel #5
0
        /* =============
         * = FUNCTIONS =
         * =============
         */


        private void Current_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
        {
            if (e.WindowActivationState != CoreWindowActivationState.Deactivated)
            {
                CheckIfTabHaveNewOutsideUpdate(TabsAccessManager.GetTabViaID(GlobalVariables.CurrentIDs));
            }
        }
Beispiel #6
0
 void OnWindowActivated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == Windows.UI.Core.CoreWindowActivationState.Deactivated)
     {
         _settingsPopup.IsOpen = false;
     }
 }
Beispiel #7
0
 /// <summary>
 /// アプリ画面アクティブ化・非アクティブ化時
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Window_Activated(object sender, WindowActivatedEventArgs e)
 {
     Debug.WriteLine(e.WindowActivationState);
     if (e.WindowActivationState == CoreWindowActivationState.CodeActivated)
     {
         Debug.WriteLine("Window_Activated state=" + e.WindowActivationState.ToString());
         updateTask(true);
     }
 }
Beispiel #8
0
 private async void Window_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
 {
     this.isApplicationWindowActive = (e.WindowActivationState != CoreWindowActivationState.Deactivated);
     if (this.needToPrintClipboardFormat)
     {
         // The clipboard was updated while the sample was in the background. If the sample is now in the foreground,
         // handle the new content.
         await HandleClipboardChangedAsync();
     }
 }
 private void Window_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         textBlockTitleBar.Foreground = ForegroundDeActivatedBrush;
     }
     else
     {
         textBlockTitleBar.Foreground = ForegroundActivatedBrush;
     }
 }
 private void OnActivated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         this.RootGrid.Opacity = .5;
     }
     else
     {
         this.RootGrid.Opacity = 1;
     }
 }
Beispiel #11
0
 private async void CurrentWindowActivationStateChanged(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
 {
     if ((e.WindowActivationState == Windows.UI.Core.CoreWindowActivationState.CodeActivated ||
          e.WindowActivationState == Windows.UI.Core.CoreWindowActivationState.PointerActivated) &&
         this.cameraControl.CameraStreamState != Windows.Media.Devices.CameraStreamState.Shutdown)
     {
         // When our Window loses focus due to user interaction Windows shuts it down, so we
         // detect here when the window regains focus and trigger a restart of the camera.
         await this.cameraControl.StartStreamAsync();
     }
 }
Beispiel #12
0
        private async void CoreWindow_Activated(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.WindowActivatedEventArgs args)
        {
            if (args.WindowActivationState == CoreWindowActivationState.PointerActivated)
            {
                var clipboard = await Services.Helpers.ClipboardHelper.CheckClipboard();

                if (clipboard != null)
                {
                    HohoemaNotificationService.ShowInAppNotification(clipboard.Type, clipboard.Id);
                }
            }
        }
Beispiel #13
0
 private void Current_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         if (ApplicationSettings.UpdateAppAutomatically.Value && new Type[] { typeof(Pages.Settings.Root), typeof(Pages.Play) }.Contains(contentFrame.CurrentSourcePageType))
         {
             // We can update now
             //_ = DoApplicationUpdateIfRequired();
             // No more auto update. Manual update is reliable
         }
     }
 }
Beispiel #14
0
        private async void CoreWindow_Activated(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.WindowActivatedEventArgs args)
        {
            if (args.WindowActivationState == CoreWindowActivationState.PointerActivated)
            {
                NiconicoId?maybeId = await ClipboardHelper.CheckClipboard();

                if (maybeId is not null and NiconicoId id)
                {
                    HohoemaNotificationService.ShowInAppNotification(id);
                }
            }
        }
Beispiel #15
0
        private void Current_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
        {
            switch (e.WindowActivationState)
            {
            case CoreWindowActivationState.CodeActivated:
            case CoreWindowActivationState.PointerActivated:
                Windows.Storage.ApplicationData.Current.LocalSettings.Values["IsWindowInFocus"] = true;
                break;

            case CoreWindowActivationState.Deactivated:
                Windows.Storage.ApplicationData.Current.LocalSettings.Values["IsWindowInFocus"] = false;
                break;
            }
        }
Beispiel #16
0
 private void Current_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         Debug.WriteLine("Deactivated " + DateTime.Now);
         IncrementPings = true;
     }
     else
     {
         Debug.WriteLine("Activated " + DateTime.Now);
         NumberPings    = 0;
         IncrementPings = false;
     }
 }
Beispiel #17
0
 private void Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.CodeActivated)
     {
         canvas.Paused = false;
     }
     else if (e.WindowActivationState == CoreWindowActivationState.PointerActivated)
     {
         canvas.Paused = false;
     }
     else if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         canvas.Paused = true;
     }
 }
Beispiel #18
0
        private void Current_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
        {
            switch (e.WindowActivationState)
            {
            case CoreWindowActivationState.CodeActivated:
            case CoreWindowActivationState.PointerActivated:
                ToastNotificationManager.History.Clear();      //Clear existing notifications for this app
                Windows.Storage.ApplicationData.Current.LocalSettings.Values["IsWindowInFocus"] = true;
                break;

            case CoreWindowActivationState.Deactivated:
                Windows.Storage.ApplicationData.Current.LocalSettings.Values["IsWindowInFocus"] = false;
                break;
            }
        }
Beispiel #19
0
 private void Current_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == Windows.UI.Core.CoreWindowActivationState.Deactivated)
     {
         AppTitleBar.Opacity           = 0.75;
         stackTitleInteractive.Opacity = 0.25;
         gridCommandBar.Opacity        = 0.75;
     }
     else
     {
         AppTitleBar.Opacity           = 1;
         stackTitleInteractive.Opacity = 1;
         gridCommandBar.Opacity        = 1;
     }
 }
Beispiel #20
0
 private void CoreWindowOnActivated(CoreWindow sender, WindowActivatedEventArgs args)
 {
     try
     {
         if (args.WindowActivationState == CoreWindowActivationState.Deactivated)
         {
             LightOff();
         }
         else
         {
             LightOn();
         }
     }
     catch (Exception ex)
     {
         logException(ex);
     }
 }
Beispiel #21
0
        async void Current_Activated(object sender, WindowActivatedEventArgs e)
        {

            if (e.WindowActivationState ==
                Windows.UI.Core.CoreWindowActivationState.Deactivated)
            {
            }
            else if (e.WindowActivationState ==
                Windows.UI.Core.CoreWindowActivationState.CodeActivated)
            {
                StatusBar statusBar = StatusBar.GetForCurrentView();
                statusBar.ProgressIndicator.Text = "Đang tải nội dung";
                await statusBar.ProgressIndicator.ShowAsync();
                var sampleDataGroups = await SampleDataSource.GetGroupsAsync();
                this.DefaultViewModel["Groups"] = sampleDataGroups;
                await statusBar.ProgressIndicator.HideAsync();
                
            }
        }
        private async void Current_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
        {
            if (e.WindowActivationState != CoreWindowActivationState.Deactivated)
            {
                isFocused = true;

                if (ViewModel.SelectedItem != null)
                {
                    DataPackageView dataPackageView = Clipboard.GetContent();
                    if (dataPackageView.Contains(StandardDataFormats.Text))
                    {
                        string text = await dataPackageView.GetTextAsync();

                        // Return if length is more than 20 - it's pretty evident at this point that a color string hasn't been copied
                        if (text.Length > 20)
                        {
                            return;
                        }

                        // Try and create a color from the string
                        Color?color = ConvertToColor.GenerateColorFromString(text);

                        // If the color is null or the text is already the currentClipboardValue then return
                        if (color == null || text == currentClipboardValue)
                        {
                            return;
                        }

                        // Show notification
                        buttonImportFromClipboard.DataContext = new ClipboardColor(Helpers.ColorHelper.GetNearestName(color.Value), color.Value);
                        ShowClipboardNotification();
                        currentClipboardValue = text;
                    }
                }
            }
            else
            {
                isFocused = false;
            }
        }
 void Current_Activated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == Windows.UI.Core.CoreWindowActivationState.Deactivated)
     {
         _settingPopup.IsOpen = false;
     }
 }
Beispiel #24
0
 private static void OnWindowActivated(object sender, WindowActivatedEventArgs e)
 {
     UpdateStatusBar();
 }
Beispiel #25
0
        private async void ApplicationState_Activated(object sender, WindowActivatedEventArgs e)
        {
            if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
            {
                IsBackground = true;
                if (!IsPlaying)
                    return;

                // If we're playing a video, just pause.
                if (!_isAudioMedia)
                {
                    // TODO: Route Video Player calls through Media Service
                    //_vlcService.Pause();
                    return;
                }

                // Otherwise, set the MediaElement's source to the Audio File in question,
                // and play it with a volume of zero. This allows _vlcService's audio to continue
                // to play in the background. SetSource should have it's source set to a programmatically
                // generated stream of blank noise, just incase the audio file in question isn't support by
                // Windows.
                var file = await _historyService.RetrieveFile(_lastMrl.Replace("file://", ""));
                var stream = await file.OpenAsync(FileAccessMode.Read);
                _mediaElement.SetSource(stream, file.ContentType);
                _mediaElement.Play();
                _mediaElement.IsLooping = true;
                _mediaElement.Volume = 0;
            }
            else
            {
                IsBackground = false;
                if (!IsPlaying)
                    return;

                // If we're playing a video, start playing again.
                if (!_isAudioMedia)
                {
                    // TODO: Route Video Player calls through Media Service
                    //_vlcService.Play();
                    return;
                }

                _mediaElement.Stop();
            }
        }
Beispiel #26
0
 private void Current_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
 {
     UpdateUpgradeToPremiumVisibility();
 }
Beispiel #27
0
        private void Window_Activated(object sender, WindowActivatedEventArgs e)
        {
            // there is currently a bug that prevents the VisualStateManager to
            // detect the initial state when the application is restored in
            // "Desktop" mode.

            // So we register to this event once, and make the changes ourselves.

            var mode = UIViewSettings.GetForCurrentView().UserInteractionMode;
            if (mode == UserInteractionMode.Mouse)
            {
                BottomCommandBar.Visibility = Visibility.Collapsed;
                Header.Visibility = Visibility.Collapsed;
                TopCommandBar.Visibility = Visibility.Visible;

                Grid.SetRow(SplitView, 0);
                Grid.SetRowSpan(SplitView, 2);
            }
            else
            {
                BottomCommandBar.Visibility = Visibility.Visible;
                Header.Visibility = Visibility.Visible;
                TopCommandBar.Visibility = Visibility.Visible;

                Grid.SetRow(SplitView, 1);
                Grid.SetRowSpan(SplitView, 1);
            }

            // we do not want to be notified next time

            Window.Current.Activated -= Window_Activated;
        }
Beispiel #28
0
 private void ApplicationState_Activated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         IsBackground = true;
         if (Locator.MediaPlaybackViewModel.CurrentMedia == null) return;
         if (!Locator.MediaPlaybackViewModel.IsPlaying) return;
         // If we're playing a video, just pause.
         if (Locator.MediaPlaybackViewModel.PlayingType == PlayingType.Video)
         {
             // TODO: Route Video Player calls through Media Service
             if (!Locator.SettingsVM.ContinueVideoPlaybackInBackground)
             {
                 Locator.MediaPlaybackViewModel._mediaService.Pause();
             }
         }
     }
     else
     {
         IsBackground = false;
     }
 }
Beispiel #29
0
 void WindowSelected(object sender, WindowActivatedEventArgs e)
 {
     UpdateBackendConnection();
 }
 void IWindowEventSink.OnActivated(object sender, WindowActivatedEventArgs e)
 {
 }
		private void Window_Activated( object sender, WindowActivatedEventArgs e )
		{
			var app = (WindowsRTApplication) Application.Current;

			if( app.RootFrame != null )
			{
				app.RootFrame.Navigated += RootFrame_Navigated;
				Window.Current.Activated -= Window_Activated;
			}
		}
Beispiel #32
0
 void CoreWindow_Activated(CoreWindow sender, WindowActivatedEventArgs args)
 {
     try
     {
         if (args.WindowActivationState != CoreWindowActivationState.Deactivated &&
             Frontend.Settings.focusTextInput &&
             CurrentConversation != null
         )
         {
             this.SendText.Focus(FocusState.Programmatic);
         }
     }
     catch (Exception uiEx) { Frontend.UIError(uiEx); }
 }
Beispiel #33
0
        private void Current_Activated(object sender, WindowActivatedEventArgs e)
        {
            
            var win = sender as Window;
//#if WINDOWS_PHONE_APP
//             if (e. != CoreWindowActivationState.Deactivated)
//                {
//                    Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
//                }
//                else
//                {
//                    Windows.Phone.UI.Input.HardwareButtons.BackPressed -= HardwareButtons_BackPressed;
//                }
//# el
#if WINDOWS_UWP
            if (Windows.Foundation.Metadata.ApiInformation.IsTypePresent("Windows.Phone.UI.Input.HardwareButtons"))
            {
                if (e.WindowActivationState != CoreWindowActivationState.Deactivated)
                {
                    Windows.Phone.UI.Input.HardwareButtons.BackPressed += HardwareButtons_BackPressed;
                }
                else
                {
                    Windows.Phone.UI.Input.HardwareButtons.BackPressed -= HardwareButtons_BackPressed;
                }
            }

            if (e.WindowActivationState != CoreWindowActivationState.Deactivated)
            {
                SubscribeToBackRequestedEvent();
            }
            else
            {
                UnsubscribeFromBackRequestedEvent();
            }
#endif
        }
 async void Current_Activated(object sender, WindowActivatedEventArgs e)
 {
   if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
   {
     OnForegroundDeactivated();
   }
   else
   {
     OnForegroundActivated();
   }
 }
Beispiel #35
0
 private void Window_FocusChanged(CoreWindow sender, WindowActivatedEventArgs args)
 {
     if (args.WindowActivationState == CoreWindowActivationState.Deactivated)
         Platform.IsActive = false;
     else
         Platform.IsActive = true;
 }
 private void Current_Activated(object sender, WindowActivatedEventArgs e)
 {
     UpdateOrientation();
 }
Beispiel #37
0
 private void onCoreWindowAppActivated(CoreWindow sender, WindowActivatedEventArgs args)
 {
     logger.LogMessage($"Core window activated with state {args.WindowActivationState}");
 }
Beispiel #38
0
        /*private void OnDeactivated(object sender, DeactivatedEventArgs e)
        {
            isForeground = false;
            BusProvider.Instance.Post(new AppToBackgroundEvent());
            SoomlaUtils.LogDebug(TAG, "became background");
        }*/
        //private void OnActivated(object sender, ActivatedEventArgs e)
        //private void OnActivated(CoreApplicationView view, IActivatedEventArgs e)
        private void OnActivated(object sender, WindowActivatedEventArgs e)
        {
            if (e.WindowActivationState == CoreWindowActivationState.CodeActivated)
            {
                isForeground = true;
                BusProvider.Instance.Post(new AppToForegroundEvent());
                SoomlaUtils.LogDebug(TAG, "became foreground");
            }

            if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
            {
                isForeground = false;
                BusProvider.Instance.Post(new AppToBackgroundEvent());
                SoomlaUtils.LogDebug(TAG, "became background");
            }
        }
Beispiel #39
0
 private void CoreWindow_Activated(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.WindowActivatedEventArgs args)
 {
     _lastActivationState = args.WindowActivationState;
 }
Beispiel #40
0
 private void OnWindowActivated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         this.settingsPopup.IsOpen = false;
     }
 }
Beispiel #41
0
 private void Current_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
 => UpdateActiveState(e.WindowActivationState != Windows.UI.Core.CoreWindowActivationState.Deactivated);
Beispiel #42
0
 private void OnHostWindowActivated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         if (internalPopup != null)
             internalPopup.IsOpen = false;
     }
 }
Beispiel #43
0
 private void OnWindowActivated(object sender, WindowActivatedEventArgs e)
 {
     if (CloseOnWindowChange && e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         Dismiss();
     }
 }
 private void OnWindowActivated(object sender, WindowActivatedEventArgs e)
 {
     this.isApplicationWindowActive = (e.WindowActivationState != CoreWindowActivationState.Deactivated);
     if (this.needToPrintClipboardFormat)
     {
         // The clipboard was updated while the sample was in the background. If the sample is now in the foreground, 
         // display the new content. 
         HandleClipboardChanged();
     }
 }
Beispiel #45
0
 private void CoreWindow_Activated(CoreWindow sender, WindowActivatedEventArgs args)
 {
     // Forget about the held keys when we lose focus as we don't
     // receive key events for them while we are in the background
     if (args.WindowActivationState == CoreWindowActivationState.Deactivated)
         _keys.Clear();
 }
Beispiel #46
0
 private void CurrentActivated(object sender, WindowActivatedEventArgs e)
 {
     Window.Current.SizeChanged += WindowSizeChanged;
 }
Beispiel #47
0
 private void OnWindowActivated(object sender, WindowActivatedEventArgs e)
 {
     Window.Current.Activated -= OnWindowActivated;
     SubscribeEvents();
     _popup.Child = CreateDialog();
     _popup.IsOpen = true;
 }
Beispiel #48
0
        private void Current_Activated(object sender, WindowActivatedEventArgs e)
        {
            if (e.WindowActivationState != CoreWindowActivationState.Deactivated)
            {
                TitleBar.Background = new SolidColorBrush(Color.FromArgb(255, 0, 150, 136));
                TitleText.Foreground = new SolidColorBrush(Color.FromArgb(255, 255, 255, 255));
            }
            else
            {
                TitleBar.Background = new SolidColorBrush(Color.FromArgb(255, 255, 255, 255));
                TitleText.Foreground = new SolidColorBrush(Color.FromArgb(128, 0, 0, 0));
            }

            SettingsButton.Foreground = TitleText.Foreground;
        }
 private void Current_Activated(object sender, WindowActivatedEventArgs e)
 {
     // Initialize the database if necessary
     DbInitRepository.InitData();
 }
Beispiel #50
0
 private void OnWindowActivated(CoreWindow window, WindowActivatedEventArgs args)
 {
     //throw new NotImplementedException();
 }
 private void OnWindowActivated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
         _popUp.IsOpen = false;
 }