给设置界面添加是否最小化到通知栏选项

This commit is contained in:
2025-07-09 20:48:14 +08:00
parent cba1c1abf4
commit 5915a6c87b
4 changed files with 41 additions and 3 deletions

View File

@@ -33,9 +33,17 @@ public partial class MainView : Window
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
{
// Hide the window instead of closing it
e.Cancel = true;
Hide();
var settings = Config.ConnectionSettings.Load();
if (settings.MinimizeToTrayOnClose)
{
// Hide the window instead of closing it
e.Cancel = true;
Hide();
}
else
{
Application.Current.Shutdown();
}
}
public void ShowApplication()