Example #1
0
        private void SettingsAction(object o)
        {
            var settings = new SettingsWindow();

            settings.Show();
            settings.Activate();
        }
Example #2
0
        public void ShowSettingsWindow()
        {
            if (_settingsWindow == null)
            {
                _settingsWindow = new SettingsWindow();

                var cancelCommand = new RelayCommand(() =>
                {
                    Properties.Settings.Default.Reload();
                    DestroySettingsWindow();
                    ResetSettings();
                });

                var settingsViewModel = new SettingsViewModel(_tempApplicationData)
                {
                    CancelCommand = cancelCommand,
                    CloseCommand  = cancelCommand,
                    OkCommand     = new RelayCommand(() =>
                    {
                        SaveSettings();
                        DestroySettingsWindow();
                    }),
                    EditBookmarkCommand   = new RelayCommand <BookmarkViewModel>(EditBookmark),
                    DeleteBookmarkCommand = new RelayCommand <BookmarkViewModel>(DeleteBookmark),
                    NewBookmarkCommand    = new RelayCommand(AddNewBookmark)
                };
                _settingsWindow.DataContext = settingsViewModel;
            }

            _settingsWindow.Show();
            _settingsWindow.Activate();
        }
Example #3
0
        private void ButtonSettings(object sender, RoutedEventArgs e)
        {
            SettingsWindow settingsWindow = new SettingsWindow(this);

            settingsWindow.Show();
            settingsWindow.Activate();
            this.Hide();
        }
Example #4
0
 private static void ShowSettingsWindow()
 {
     if (_settingsWindow != null && _settingsWindow.IsVisible)
     {
         _settingsWindow.Activate();
         return;
     }
     _settingsWindow = new SettingsWindow();
     _settingsWindow.Show();
 }
Example #5
0
 public void OpenAppSettingsWindow()
 {
     if (settingsWindow != null)
     {
         settingsWindow.Activate();
     }
     else
     {
         settingsWindow = new SettingsWindow();
         settingsWindow.Show();
         Logic.Execute(logic => logic.settings.windowSettings.isOpenSettingsWindow = true, true);
     }
 }
        public void Execute(object parameter)
        {
            if (_window != null)
            {
                _window.Activate();
                return;
            }

            _window         = new SettingsWindow();
            _window.Closed += Window_Closed;
            _window.Show();
            CommandManager.InvalidateRequerySuggested();
        }
Example #7
0
        private void OnTrayIconContextMenuItemClicked(string obj)
        {
            if (obj == Constants.ContextMenu.Exit)
            {
                trayIcon.Dispose();
                System.Windows.Application.Current.Shutdown();
            }

            if (obj == Constants.ContextMenu.Settings)
            {
                currentSettingsWindow             = new SettingsWindow();
                currentSettingsWindow.DataContext = settingsViewModel;
                currentSettingsWindow.Show();
                currentSettingsWindow.Activate();
            }
        }
Example #8
0
 void OpenSettingsWindow()
 {
     if (!ready)
     {
         return;
     }
     if (stWindow != null)
     {
         stWindow.Activate();
         return;
     }
     stWindow         = new SettingsWindow(viewModel, sessions, wsServer);
     stWindow.Closed += delegate { stWindow = null; };
     ElementHost.EnableModelessKeyboardInterop(stWindow);
     stWindow.Show();
     stWindow.Activate();
 }
Example #9
0
 private async void OnSettingsClicked(object sender, System.Windows.Input.MouseButtonEventArgs e)
 {
     try
     {
         if (_isVisible)
         {
             await HideAsync();
         }
         SettingsWindow settingsWindow = new SettingsWindow();
         settingsWindow.Show();
         settingsWindow.Activate();
     }
     catch (Exception ex)
     {
         _logger.LogWarn(LogEvents.UiOpErr, "Failed to open SettingsWindow!", ex);
         ex.Notify();
     }
 }
Example #10
0
 private void SettingsMenu_Click(object sender, RoutedEventArgs e)
 {
     if (_settingsWindow != null)
     {
         if (_settingsWindow.WindowState == WindowState.Minimized)
         {
             _settingsWindow.WindowState   = WindowState.Normal;
             _settingsWindow.SizeToContent = SizeToContent.WidthAndHeight;
         }
         _settingsWindow.Activate();
         return;
     }
     _settingsWindow = new SettingsWindow {
         Owner = this
     };
     _settingsWindow.Closing += (o, args) =>
     {
         _settingsWindow.Owner = null;
         _settingsWindow       = null;
     };
     _settingsWindow.Show();
 }
Example #11
0
        private void MenuItemSettings_Click(object sender, RoutedEventArgs e)
        {
            if (_termsOfUseWindow != null)
            {
                return;
            }

            if (_settingsWindow != null)
            {
                _settingsWindow.Activate();
                return;
            }

            _settingsWindow = new SettingsWindow();
            StaticHelper.CenterOnScreen(_settingsWindow);
            bool?dialogResult = _settingsWindow.ShowDialog();

            if (dialogResult.HasValue && dialogResult.Value == true)
            {
                ApplySettings();
            }

            _settingsWindow = null;
        }