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:
Brett Hewitson 2021-11-23 15:26:06 +10:00
parent 229ee09049
commit 34582ca91b
20 changed files with 286 additions and 58 deletions

View file

@ -152,8 +152,11 @@ namespace ServerManagerTool
}
}
this.Left = Config.Default.MainWindow_Left;
this.Top = Config.Default.MainWindow_Top;
this.Height = Config.Default.MainWindow_Height;
this.Width = Config.Default.MainWindow_Width;
this.WindowState = Config.Default.MainWindow_WindowState;
// hook into the language change event
GlobalizedApplication.Instance.GlobalizationManager.ResourceDictionaryChangedEvent += ResourceDictionaryChangedEvent;
@ -197,6 +200,15 @@ namespace ServerManagerTool
this.Activate();
}
private void Window_LocationChanged(object sender, EventArgs e)
{
if (this.WindowState == WindowState.Normal)
{
Config.Default.MainWindow_Left = Math.Max(0D, this.Left);
Config.Default.MainWindow_Top = Math.Max(0D, this.Top);
}
}
private void Window_SizeChanged(object sender, SizeChangedEventArgs e)
{
if (this.WindowState != WindowState.Minimized)