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;
|
||||
|
||||
|
|
@ -26,6 +28,7 @@ namespace ServerManagerTool
|
|||
|
||||
public static readonly DependencyProperty AppInstanceProperty = DependencyProperty.Register(nameof(AppInstance), typeof(App), typeof(GlobalSettingsControl), new PropertyMetadata(null));
|
||||
public static readonly DependencyProperty IsAdministratorProperty = DependencyProperty.Register(nameof(IsAdministrator), typeof(bool), typeof(GlobalSettingsControl), new PropertyMetadata(false));
|
||||
public static readonly DependencyProperty WindowStatesProperty = DependencyProperty.Register(nameof(WindowStates), typeof(List<WindowState>), typeof(GlobalSettingsControl), new PropertyMetadata(new List<WindowState>()));
|
||||
|
||||
public GlobalSettingsControl()
|
||||
{
|
||||
|
|
@ -35,6 +38,12 @@ namespace ServerManagerTool
|
|||
this.IsAdministrator = SecurityUtils.IsAdministrator();
|
||||
this.Version = GetDeployedVersion();
|
||||
|
||||
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);
|
||||
|
||||
|
|
@ -65,6 +74,12 @@ namespace ServerManagerTool
|
|||
set { SetValue(IsAdministratorProperty, value); }
|
||||
}
|
||||
|
||||
public List<WindowState> WindowStates
|
||||
{
|
||||
get { return (List<WindowState>)GetValue(WindowStatesProperty); }
|
||||
set { SetValue(WindowStatesProperty, value); }
|
||||
}
|
||||
|
||||
public string Version
|
||||
{
|
||||
get;
|
||||
|
|
@ -287,6 +302,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)
|
||||
{
|
||||
Config.CultureName = AvailableLanguages.Instance.SelectedLanguage;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue