예제 #1
0
 public void ShowShellWindow()
 {
     _shellWindow.ShowInTaskbar = true;
     _shellWindow.WindowState   = WindowState.Normal;
     _shellWindow.Visibility    = Visibility.Visible;
     _shellWindow.Activate();
 }
예제 #2
0
        private void Btn_color_Click(object sender, RoutedEventArgs e)
        {
            if (accentThemeTestWindow != null)
            {
                accentThemeTestWindow.Activate();
                return;
            }

            accentThemeTestWindow = new AccentStyleWindow()
            {
                Owner = this
            };
            accentThemeTestWindow.Closed += (o, args) => accentThemeTestWindow = null;
            accentThemeTestWindow.Left    = Left + ActualWidth / 2.0;
            accentThemeTestWindow.Top     = Top + ActualHeight / 2.0;
            accentThemeTestWindow.Show();
        }
 private void QuickDropDialog_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (_parent.WindowState == WindowState.Minimized)
     {
         _parent.WindowState = WindowState.Normal;
     }
     _parent.Activate();
     e.Handled = true;
 }
 private void ChangeAppStyleButtonClick(object sender, RoutedEventArgs e)
 {
     if (accentThemeWindow != null)
     {
         accentThemeWindow.Activate(); return;
     }
     accentThemeWindow         = new AccentStyleWindow();
     accentThemeWindow.Owner   = this;
     accentThemeWindow.Closed += (o, args) => accentThemeWindow = null;
     accentThemeWindow.Left    = this.Left + this.ActualWidth / 2.0;
     accentThemeWindow.Top     = this.Top + this.ActualHeight / 2.0;
     accentThemeWindow.Show();
 }
예제 #5
0
        public static void ActivateDialog(Type window)
        {
            MetroWindow dialog = null;

            for (int i = 0; i < Application.Current.Windows.Count; i++)
            {
                var currentWindow = Application.Current.Windows[i];
                if (currentWindow != null && currentWindow.GetType() == window)
                {
                    dialog = Application.Current.Windows[i] as ImportDialog;
                    break;
                }
            }
            dialog?.Activate();
        }
        private void ChangeAppStyleButtonClick(object sender, RoutedEventArgs e)
        {
            if (_accentThemeTestWindow != null)
            {
                _accentThemeTestWindow.Activate();
                return;
            }

            _accentThemeTestWindow         = new AccentStyleWindow(ViewModel.ThemeViewModel);
            _accentThemeTestWindow.Owner   = this;
            _accentThemeTestWindow.Closed += (o, args) => _accentThemeTestWindow = null;
            _accentThemeTestWindow.Left    = Left + ActualWidth / 4.0;
            _accentThemeTestWindow.Top     = Top + ActualHeight / 4.0;
            _accentThemeTestWindow.Show();
        }
        private void ChangeSettingsButtonClick(object sender, RoutedEventArgs e)
        {
            if (_settingsWindow != null)
            {
                _settingsWindow.Activate();
                return;
            }

            _settingsWindow         = new SettingsWindow(ViewModel.SettingsViewModel);
            _settingsWindow.Owner   = this;
            _settingsWindow.Closed += (o, args) => _settingsWindow = null;
            _settingsWindow.Left    = Left + ActualWidth / 6.0;
            _settingsWindow.Top     = Top + ActualHeight / 6.0;
            _settingsWindow.Show();
        }
예제 #8
0
        private void ChangeAppStyleButtonClick(object sender, RoutedEventArgs e)
        {
            if (accentThemeTestWindow != null)
            {
                accentThemeTestWindow.Activate();
                return;
            }

            accentThemeTestWindow         = new AccentStyleWindow();
            accentThemeTestWindow.Owner   = this;
            accentThemeTestWindow.Closed += (o, args) => accentThemeTestWindow = null;
            accentThemeTestWindow.WindowStartupLocation = WindowStartupLocation.CenterScreen;
            accentThemeTestWindow.ShowMinButton         = false;
            accentThemeTestWindow.ShowMaxRestoreButton  = false;
            accentThemeTestWindow.Show();
        }
예제 #9
0
        public static bool FocusWindow()
        {
            if (MainWindow == null)
            {
                return(false);
            }
            if (MainWindow.WindowState == WindowState.Minimized)
            {
                MainWindow.WindowState = WindowState.Normal;
            }

            MainWindow.Activate();
            MainWindow.Topmost = true;  // important
            MainWindow.Topmost = false; // important
            MainWindow.Focus();         // important
            return(true);
        }
예제 #10
0
        private void ChangeAppStyleButtonClick(object sender, RoutedEventArgs e)
        {
            if (accentThemeWindow != null)
            {
                accentThemeWindow.Activate();
                return;
            }
            accentThemeWindow         = new AccentStyleWindow();
            accentThemeWindow.Owner   = this;
            accentThemeWindow.Closed += (o, args) => accentThemeWindow = null;
            accentThemeWindow.Left    = this.Left + this.ActualWidth / 2.0;
            accentThemeWindow.Top     = this.Top + this.ActualHeight / 2.0;
            if ((bool)accentThemeWindow.ShowDialog())
            {
            }
            ClientSettings Settings = new ClientSettings();

            Settings.DeserializeSetting();
            Settings.SetSetting(this);
        }
예제 #11
0
        private void SettingsButtonClick(object sender, RoutedEventArgs e)
        {
            if (settingsWindow != null)
            {
                settingsWindow.Activate();
                return;
            }

            settingsWindow = new SettingsWindow(
                this,
                BoardViewModelObject.Game.Board.Size,
                BoardViewModelObject.Game.Board.NumberOfWhitePiecesAtBeggining,
                BoardViewModelObject.Game.Board.NumberOfBlackPiecesAtBeggining,
                BoardViewModelObject.Game.Variant,
                BoardViewModelObject.Game.WhitePlayerEngine,
                BoardViewModelObject.Game.BlackPlayerEngine,
                BoardViewModelObject.MoveAnimationTime);
            settingsWindow.Owner   = this;
            settingsWindow.Closed += (o, args) => settingsWindow = null;

            settingsWindow.Show();
        }
예제 #12
0
        void IHandle <ShowMainWindowEvent> .Handle(ShowMainWindowEvent message)
        {
            if (!_window.IsVisible)
            {
                _window.Show();
            }

            if (_window.WindowState == WindowState.Minimized)
            {
                _window.WindowState = WindowState.Normal;
            }

            _window.Activate();

            _window.Topmost = true;
            _window.Topmost = false;

            _window.Focus();

            if (message.SelectMostRecentMessage)
            {
                MessageListViewModel.TryGetValidSelectedIndex();
            }
        }
예제 #13
0
 private void QuickDropDialog_OnMouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     _parent.Activate();
     Close();
 }