Save all window positions

This commit is contained in:
2025-06-08 02:09:48 +02:00
parent 2082072532
commit 8b0d2153b0
9 changed files with 109 additions and 9 deletions

View File

@ -30,7 +30,9 @@ namespace unison
InitHwnd();
InitializeComponent();
DefaultState(true);
WindowState = WindowState.Minimized;
Top = Properties.Settings.Default.MainWindowTop;
Left = Properties.Settings.Default.MainWindowLeft;

View File

@ -6,7 +6,7 @@
xmlns:emoji="clr-namespace:Emoji.Wpf;assembly=Emoji.Wpf"
xmlns:properties="clr-namespace:unison.Resources"
mc:Ignorable="d"
Title="Radios" Closing="Window_Closing" SizeToContent="WidthAndHeight" ResizeMode="NoResize">
Title="Radios" Closing="Window_Closing" LocationChanged="Window_LocationChanged" SizeToContent="WidthAndHeight" ResizeMode="NoResize">
<Grid Margin="0,5,0,0">
<StackPanel>

View File

@ -26,6 +26,9 @@ namespace unison
InitHwnd();
WindowState = WindowState.Minimized;
Top = Properties.Settings.Default.RadiosWindowTop;
Left = Properties.Settings.Default.RadiosWindowLeft;
}
public async void Initialize()

View File

@ -6,7 +6,7 @@
xmlns:emoji="clr-namespace:Emoji.Wpf;assembly=Emoji.Wpf"
xmlns:properties="clr-namespace:unison.Resources" xmlns:sys="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="d"
Closing="Window_Closing" Title="{x:Static properties:Resources.Settings}" ResizeMode="CanMinimize" Icon="/Resources/icon-full.ico" WindowStyle="ToolWindow" SizeToContent="WidthAndHeight">
Title="{x:Static properties:Resources.Settings}" Closing="Window_Closing" LocationChanged="Window_LocationChanged" ResizeMode="CanMinimize" Icon="/Resources/icon-full.ico" WindowStyle="ToolWindow" SizeToContent="WidthAndHeight">
<Window.Resources>
<x:Array x:Key="ShortcutItems" Type="sys:String">

View File

@ -45,11 +45,13 @@ namespace unison
{
InitHwnd();
InitializeComponent();
Initialize();
DataContext = this;
WindowState = WindowState.Minimized;
Initialize();
Top = Properties.Settings.Default.SettingsWindowTop;
Left = Properties.Settings.Default.SettingsWindowLeft;
}
void Initialize()

View File

@ -6,7 +6,7 @@
xmlns:emoji="clr-namespace:Emoji.Wpf;assembly=Emoji.Wpf"
xmlns:properties="clr-namespace:unison.Resources" xmlns:sys="clr-namespace:System;assembly=System.Runtime"
mc:Ignorable="d"
Title="Shuffle" Closing="Window_Closing" SizeToContent="WidthAndHeight" ResizeMode="NoResize">
Title="Shuffle" Closing="Window_Closing" LocationChanged="Window_LocationChanged" SizeToContent="WidthAndHeight" ResizeMode="NoResize">
<Window.Resources>
<x:Array x:Key="FilterType" Type="sys:String">

View File

@ -41,6 +41,9 @@ namespace unison
WindowState = WindowState.Minimized;
Top = Properties.Settings.Default.ShuffleWindowTop;
Left = Properties.Settings.Default.ShuffleWindowLeft;
_mpd = (MPDHandler)Application.Current.Properties["mpd"];
_shuffle = (ShuffleHandler)Application.Current.Properties["shuffle"];
}