mirror of
https://github.com/tribufu/ServerManagers
synced 2026-05-06 15:17:34 +00:00
1. Main window now stored the Left and Top positions.
2. Added global setting to set the start mode of the Main Window.
This commit is contained in:
parent
229ee09049
commit
34582ca91b
20 changed files with 286 additions and 58 deletions
|
|
@ -4,6 +4,7 @@ using ServerManagerTool.Common;
|
|||
using ServerManagerTool.Common.Lib;
|
||||
using ServerManagerTool.Common.Utils;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
|
@ -11,6 +12,7 @@ using System.Threading;
|
|||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Input;
|
||||
using System.Xml;
|
||||
using WPFSharp.Globalizer;
|
||||
|
||||
|
|
@ -27,6 +29,7 @@ namespace ServerManagerTool
|
|||
public static readonly DependencyProperty IsAdministratorProperty = DependencyProperty.Register(nameof(IsAdministrator), typeof(bool), typeof(GlobalSettingsControl), new PropertyMetadata(false));
|
||||
public static readonly DependencyProperty CurrentConfigProperty = DependencyProperty.Register(nameof(CurrentConfig), typeof(Config), typeof(GlobalSettingsControl), new PropertyMetadata(null));
|
||||
public static readonly DependencyProperty CommonConfigProperty = DependencyProperty.Register(nameof(CommonConfig), typeof(CommonConfig), typeof(GlobalSettingsControl), new PropertyMetadata(null));
|
||||
public static readonly DependencyProperty WindowStatesProperty = DependencyProperty.Register(nameof(WindowStates), typeof(List<WindowState>), typeof(GlobalSettingsControl), new PropertyMetadata(new List<WindowState>()));
|
||||
|
||||
public GlobalSettingsControl()
|
||||
{
|
||||
|
|
@ -36,6 +39,12 @@ namespace ServerManagerTool
|
|||
this.CommonConfig = CommonConfig.Default;
|
||||
this.DataContext = this;
|
||||
|
||||
this.WindowStates = new List<WindowState>();
|
||||
foreach (var windowState in Enum.GetValues(typeof(WindowState)))
|
||||
{
|
||||
this.WindowStates.Add((WindowState)windowState);
|
||||
}
|
||||
|
||||
InitializeComponent();
|
||||
WindowUtils.RemoveDefaultResourceDictionary(this, Config.Default.DefaultGlobalizationFile);
|
||||
|
||||
|
|
@ -66,6 +75,12 @@ namespace ServerManagerTool
|
|||
set { SetValue(IsAdministratorProperty, value); }
|
||||
}
|
||||
|
||||
public List<WindowState> WindowStates
|
||||
{
|
||||
get { return (List<WindowState>)GetValue(WindowStatesProperty); }
|
||||
set { SetValue(WindowStatesProperty, value); }
|
||||
}
|
||||
|
||||
private string GetDeployedVersion()
|
||||
{
|
||||
XmlDocument xmlDoc = new XmlDocument();
|
||||
|
|
@ -278,6 +293,18 @@ namespace ServerManagerTool
|
|||
}
|
||||
}
|
||||
|
||||
private void ComboBox_PreviewMouseWheel(object sender, MouseWheelEventArgs e)
|
||||
{
|
||||
var comboBox = sender as ComboBox;
|
||||
if (comboBox == null)
|
||||
return;
|
||||
|
||||
if (comboBox.IsDropDownOpen)
|
||||
return;
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void LanguageSelectionComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
CurrentConfig.CultureName = AvailableLanguages.Instance.SelectedLanguage;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue