Example #1
0
 private void Window_Activated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState != CoreWindowActivationState.Deactivated)
     {
         Field.Focus(FocusState.Keyboard);
     }
 }
Example #2
0
 private void OnWindowActivated(object sender, WindowActivatedEventArgs e)
 {
     Window.Current.Activated -= OnWindowActivated;
     SubscribeEvents();
     popup.Child  = CreateDialog();
     popup.IsOpen = true;
 }
 private static void OnWindowActivated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         Close();
     }
 }
 private void MainWindow_Activated(object sender, WindowActivatedEventArgs args)
 {
     if (viewModel.Employees.Count == 0)
     {
         viewModel.Load();
     }
 }
 private void OnWindowActivated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         _popUp.IsOpen = false;
     }
 }
Example #6
0
 private void AcrylicBrush_Activated(CoreWindow sender, WindowActivatedEventArgs args)
 {
     if (BackgroundSource == AcrylicBackgroundSource.Hostbackdrop)
     {
         SetCompositionFocus(args.WindowActivationState != CoreWindowActivationState.Deactivated);
     }
 }
Example #7
0
        private void Window_Activated(object sender, WindowActivatedEventArgs e)
        {
            try
            {
                if (e.WindowActivationState == CoreWindowActivationState.PointerActivated)
                {
                    return;
                }

                bool isActiv = e.WindowActivationState == CoreWindowActivationState.CodeActivated;

                if (!isActiv)
                {
                    ChangeTimer(false);
                }
                else if (BackgroundMediaPlayer.Current.CurrentState == MediaPlayerState.Playing)
                {
                    ChangeTimer(true);
                }

                BackgroundCommunicator.SendIsWindowActiv(isActiv);
                SaveTextClass.SaveText(e.WindowActivationState.ToString());
            }
            catch { }
        }
Example #8
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;
        }
Example #9
0
 private void Current_Activated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState != CoreWindowActivationState.Deactivated)
     {
         ResetAutoHideTimer();
     }
 }
Example #10
0
 public void OnActivated(Window window, WindowActivatedEventArgs args)
 {
     if (args.WindowActivationState != WindowActivationState.Deactivated)
     {
         SetActiveWindow(window);
     }
 }
Example #11
0
 private void CurrentOnActivated(object sender, WindowActivatedEventArgs windowActivatedEventArgs)
 {
     if (windowActivatedEventArgs.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         keyBoardInput.StopUserInput();
     }
 }
Example #12
0
        private void TitleBar_Activated(object sender, WindowActivatedEventArgs e)
        {
            SolidColorBrush foreground = null;
            bool            dark       = Settings.SelectedTheme == (int)ApplicationTheme.Dark;

            if (e.WindowActivationState != CoreWindowActivationState.Deactivated)
            {
                if (dark)
                {
                    foreground = new SolidColorBrush(Colors.White);
                }
                else
                {
                    foreground = new SolidColorBrush(Colors.Black);
                }
            }
            else
            {
                foreground = new SolidColorBrush(Colors.Gray);
            }
            BackButtonText.Foreground = foreground;
            // if (integrated) {
            // ReloadButtonText.Foreground = foreground;
            // UpButtonText.Foreground = foreground;
            // SearchButtonText.Foreground = foreground;
            // CurrentStatus.Foreground = foreground;
            // }
        }
Example #13
0
 private void Current_Activated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         ResetAllSpeedNotifiers("");
     }
 }
Example #14
0
        private void Current_Activated(object sender, WindowActivatedEventArgs e)
        {
            SolidColorBrush defaultForegroundBrush  = (SolidColorBrush)Application.Current.Resources["TextFillColorPrimaryBrush"];
            SolidColorBrush inactiveForegroundBrush = (SolidColorBrush)Application.Current.Resources["TextFillColorDisabledBrush"];

            AppTitle.Foreground = e.WindowActivationState == CoreWindowActivationState.Deactivated ? inactiveForegroundBrush : defaultForegroundBrush;
        }
Example #15
0
 /// <summary>
 /// Detects if the app loses focus and gets it again
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void Current_Activated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         Logger.Log("Focus lost/Deactivated " + DateTime.Now, Category.Info, Priority.Low);
         // if the screenclip app is started, the focus of the application is lost
         if (_launchScreenClip)
         {
             // now set the scan to true
             _qrCodeScan = true;
             Logger.Log("QR-code scan is now active", Category.Info, Priority.Low);
             // user has switch the application to scan the QR-code
             _launchScreenClip = false;
         }
     }
     else
     {
         Logger.Log("Focus/Activated " + DateTime.Now, Category.Info, Priority.Low);
         // if the app is focused again, check if a QR-Code is in the clipboard
         if (_qrCodeScan)
         {
             ReadQRCodeFromClipboard();
             _qrCodeScan = false;
         }
     }
 }
Example #16
0
 private void OnWindowActivated(object sender, WindowActivatedEventArgs e)
 {
     if (CloseOnWindowChange && e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         Dismiss();
     }
 }
 /// <summary>
 /// Close the settings popup when the window is deactivated
 /// </summary>
 /// <param name="sender">the page</param>
 /// <param name="e">the window activated event arguments</param>
 private void Current_Activated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         this.settingsPopup.IsOpen = false;
     }
 }
 private async void OnWindowActivated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState != CoreWindowActivationState.Deactivated && TerminalContainer.Content is TerminalView terminal)
     {
         await terminal.FocusWebView().ConfigureAwait(true);
     }
 }
Example #19
0
 /// <summary>
 /// We use the window's activated event to force closing the Popup since a user maybe interacted with
 /// something that didn't normally trigger an obvious dismiss.
 /// </summary>
 /// <param name="sender">Instance that triggered the event.</param>
 /// <param name="e">Event data describing the conditions that led to the event.</param>
 private void OnWindowActivated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated && !this.staysOpen && this.settingsPopup != null)
     {
         this.settingsPopup.IsOpen = false;
     }
 }
Example #20
0
 private void WindowActivated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         if (Application.Current.RequestedTheme == ApplicationTheme.Dark)
         {
             title.Foreground   = new SolidColorBrush(Colors.White);
             title2.Foreground  = new SolidColorBrush(Colors.White);
             titlebg.Fill       = new SolidColorBrush(Colors.Black);
             Appbar2.Background = new SolidColorBrush(Colors.Black);
         }
         else
         {
             title.Foreground   = new SolidColorBrush(Colors.Black);
             title2.Foreground  = new SolidColorBrush(Colors.Black);
             titlebg.Fill       = new SolidColorBrush(Colors.White);
             Appbar2.Background = new SolidColorBrush(Colors.White);
         }
     }
     else
     {
         title.Foreground   = new SolidColorBrush(Colors.White);
         title2.Foreground  = new SolidColorBrush(Colors.White);
         titlebg.Fill       = App.aBrush;
         Appbar2.Background = App.aBrush;
     }
 }
Example #21
0
 private void Window_Activated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState != CoreWindowActivationState.Deactivated)
     {
         CheckForSpotifyUriInClipboard();
     }
 }
Example #22
0
 private async void Current_Activated(object sender, WindowActivatedEventArgs e)
 {
     if (lastRefreshed.AddMinutes(5) < DateTime.Now)
     {
         await getSavedData(UpdateMethod.IFOUTOFDATE);
     }
 }
    private void OnActivated(object sender, WindowActivatedEventArgs args)
    {
        void AddSubNodes(TreeViewNode parent)
        {
            if (parent.Content is CultureData cd && cd.SubCultures is not null)
            {
                foreach (var culture in cd.SubCultures)
                {
                    TreeViewNode node = new()
                    {
                        Content = culture
                    };
                    parent.Children.Add(node);

                    foreach (var subCulture in culture.SubCultures)
                    {
                        AddSubNodes(node);
                    }
                }
            }
        }

        var rootNodes = ViewModel.RootCultures.Select(cd => new TreeViewNode
        {
            Content = cd
        });

        foreach (var node in rootNodes)
        {
            treeView1.RootNodes.Add(node);
            AddSubNodes(node);
        }
    }
}
Example #24
0
        void OnWindowActivated(object sender, WindowActivatedEventArgs e)
        {
            if (!_isActiveRootManager)
            {
                _platformWindow.Activated -= OnWindowActivated;
            }

            if (_rootView.AppTitle == null)
            {
                return;
            }

            SolidColorBrush defaultForegroundBrush  = (SolidColorBrush)Application.Current.Resources["TextFillColorPrimaryBrush"];
            SolidColorBrush inactiveForegroundBrush = (SolidColorBrush)Application.Current.Resources["TextFillColorDisabledBrush"];

            if (e.WindowActivationState == WindowActivationState.Deactivated)
            {
                _rootView.AppTitle.Foreground = inactiveForegroundBrush;
            }
            else
            {
                _rootView.AppTitle.Foreground = defaultForegroundBrush;
                SetWindowTitle(_platformWindow.GetWindow()?.Title);
            }
        }
Example #25
0
 private async void OnWindowActivated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState != CoreWindowActivationState.Deactivated)
     {
         await InitializePageAsync();
     }
 }
Example #26
0
 /// <summary>
 /// Called when the window gets or loses input focus
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private static void CoreWindowOnActivated(CoreWindow sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         ActiveKeys.Clear();
     }
 }
 private void CurrentWindow_Activated(object sender, WindowActivatedEventArgs e)
 {
     if (clipboardChanged)
     {
         FromClipboard();
     }
 }
Example #28
0
        private void ApplicationState_Activated(object sender, WindowActivatedEventArgs e)
        {
            if (e.WindowActivationState == CoreWindowActivationState.Deactivated)
            {
                IsBackground = true;
                if (!Locator.MediaPlaybackViewModel.IsPlaying)
                {
                    return;
                }

                // If we're playing a video, just pause.
                if (Locator.MediaPlaybackViewModel.PlaybackService.PlayingType == PlayingType.Video)
                {
                    // TODO: Route Video Player calls through Media Service
                    if (!Locator.SettingsVM.ContinueVideoPlaybackInBackground)
                    {
                        Locator.MediaPlaybackViewModel.PlaybackService.Pause();
                    }
                }
            }
            else
            {
                IsBackground = false;
            }
        }
 void OnActivated(object sender, WindowActivatedEventArgs windowActivatedEventArgs)
 {
     if (windowActivatedEventArgs.WindowActivationState == CoreWindowActivationState.Deactivated)
     {
         Save(StorageMode.Any);
     }
 }
Example #30
0
 private void MainPage_Activated(object sender, WindowActivatedEventArgs e)
 {
     if (e.WindowActivationState != CoreWindowActivationState.Deactivated)
     {
         ApplicationData.Current.LocalSettings.Values["LastActiveGuid"] = CurrentInstanceGuid;
     }
 }