Save window location when relaunching
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
xmlns:emoji="clr-namespace:Emoji.Wpf;assembly=Emoji.Wpf"
|
||||
xmlns:properties="clr-namespace:unison.Resources"
|
||||
mc:Ignorable="d"
|
||||
Title="unison" Closing="Window_Closing" Icon="/Resources/icon-full.ico" ResizeMode="CanMinimize" SizeToContent="WidthAndHeight">
|
||||
Title="unison" Closing="Window_Closing" LocationChanged="Window_LocationChanged" Icon="/Resources/icon-full.ico" ResizeMode="CanMinimize" SizeToContent="WidthAndHeight">
|
||||
|
||||
<Window.Resources>
|
||||
<Style TargetType="Border" x:Key="UnselectedButton">
|
||||
|
@@ -27,6 +27,8 @@ namespace unison
|
||||
InitializeComponent();
|
||||
DefaultState(true);
|
||||
WindowState = WindowState.Minimized;
|
||||
Top = Properties.Settings.Default.MainWindowTop;
|
||||
Left = Properties.Settings.Default.MainWindowLeft;
|
||||
|
||||
_settingsWin = new Settings();
|
||||
_radiosWin = new Radios();
|
||||
@@ -336,5 +338,12 @@ namespace unison
|
||||
WindowState = WindowState.Minimized;
|
||||
Hide();
|
||||
}
|
||||
|
||||
private void Window_LocationChanged(object sender, EventArgs e)
|
||||
{
|
||||
Properties.Settings.Default.MainWindowTop = Top;
|
||||
Properties.Settings.Default.MainWindowLeft = Left;
|
||||
Properties.Settings.Default.Save();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user