상속: IWindowActivatedEventArgs, ICoreWindowEventArgs
 void window_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         this.Hide();
     }
 }
예제 #2
0
 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();
     }
 }
예제 #4
0
 private void OnWindowActivated(object sender, WindowsUI.Core.WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == WindowsUI.Core.CoreWindowActivationState.Deactivated)
     {
         this.popup.IsOpen = false;
     }
 }
예제 #5
0
        /* =============
         * = FUNCTIONS =
         * =============
         */


        private void Current_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
        {
            if (e.WindowActivationState != CoreWindowActivationState.Deactivated)
            {
                CheckIfTabHaveNewOutsideUpdate(TabsAccessManager.GetTabViaID(GlobalVariables.CurrentIDs));
            }
        }
예제 #6
0
 void OnWindowActivated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == Windows.UI.Core.CoreWindowActivationState.Deactivated)
     {
         _settingsPopup.IsOpen = false;
     }
 }
예제 #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);
     }
 }
예제 #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;
     }
 }
예제 #10
0
 private void OnActivated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         this.RootGrid.Opacity = .5;
     }
     else
     {
         this.RootGrid.Opacity = 1;
     }
 }
예제 #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();
     }
 }
예제 #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);
                }
            }
        }
예제 #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
         }
     }
 }
예제 #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);
                }
            }
        }
예제 #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;
            }
        }
예제 #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;
     }
 }
예제 #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;
     }
 }
예제 #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;
            }
        }
예제 #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;
     }
 }
예제 #20
0
 private void CoreWindowOnActivated(CoreWindow sender, WindowActivatedEventArgs args)
 {
     try
     {
         if (args.WindowActivationState == CoreWindowActivationState.Deactivated)
         {
             LightOff();
         }
         else
         {
             LightOn();
         }
     }
     catch (Exception ex)
     {
         logException(ex);
     }
 }
예제 #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();
                
            }
        }
예제 #22
0
        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;
     }
 }
예제 #24
0
 private static void OnWindowActivated(object sender, WindowActivatedEventArgs e)
 {
     UpdateStatusBar();
 }
예제 #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();
            }
        }
예제 #26
0
 private void Current_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
 {
     UpdateUpgradeToPremiumVisibility();
 }
예제 #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;
        }
예제 #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;
     }
 }
예제 #29
0
 void WindowSelected(object sender, WindowActivatedEventArgs e)
 {
     UpdateBackendConnection();
 }
 void IWindowEventSink.OnActivated(object sender, WindowActivatedEventArgs e)
 {
 }
예제 #31
0
		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;
			}
		}
예제 #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); }
 }
예제 #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
        }
예제 #34
0
 async void Current_Activated(object sender, WindowActivatedEventArgs e)
 {
   if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
   {
     OnForegroundDeactivated();
   }
   else
   {
     OnForegroundActivated();
   }
 }
예제 #35
0
 private void Window_FocusChanged(CoreWindow sender, WindowActivatedEventArgs args)
 {
     if (args.WindowActivationState == CoreWindowActivationState.Deactivated)
         Platform.IsActive = false;
     else
         Platform.IsActive = true;
 }
예제 #36
0
 private void Current_Activated(object sender, WindowActivatedEventArgs e)
 {
     UpdateOrientation();
 }
예제 #37
0
 private void onCoreWindowAppActivated(CoreWindow sender, WindowActivatedEventArgs args)
 {
     logger.LogMessage($"Core window activated with state {args.WindowActivationState}");
 }
예제 #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");
            }
        }
예제 #39
0
 private void CoreWindow_Activated(Windows.UI.Core.CoreWindow sender, Windows.UI.Core.WindowActivatedEventArgs args)
 {
     _lastActivationState = args.WindowActivationState;
 }
예제 #40
0
 private void OnWindowActivated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         this.settingsPopup.IsOpen = false;
     }
 }
예제 #41
0
 private void Current_Activated(object sender, Windows.UI.Core.WindowActivatedEventArgs e)
 => UpdateActiveState(e.WindowActivationState != Windows.UI.Core.CoreWindowActivationState.Deactivated);
예제 #42
0
파일: Flyout.cs 프로젝트: peterluo0822/Chat
 private void OnHostWindowActivated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         if (internalPopup != null)
             internalPopup.IsOpen = false;
     }
 }
예제 #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();
     }
 }
예제 #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();
 }
예제 #46
0
 private void CurrentActivated(object sender, WindowActivatedEventArgs e)
 {
     Window.Current.SizeChanged += WindowSizeChanged;
 }
예제 #47
0
 private void OnWindowActivated(object sender, WindowActivatedEventArgs e)
 {
     Window.Current.Activated -= OnWindowActivated;
     SubscribeEvents();
     _popup.Child = CreateDialog();
     _popup.IsOpen = true;
 }
예제 #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;
        }
예제 #49
0
 private void Current_Activated(object sender, WindowActivatedEventArgs e)
 {
     // Initialize the database if necessary
     DbInitRepository.InitData();
 }
예제 #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;
 }