Fix MainWindow visibility logic:

- Restore Hide() method in MainViewModel (accidentally deleted)
- Fix Show() method which was incorrectly calling HideRequested
- Ensure OpenSettings cleanly hides MainWindow before showing SettingsWindow
This commit is contained in:
Hongtao Zhang 2026-01-19 00:16:59 -08:00
parent 2b328e552a
commit 32aa3ffdc5

View file

@ -208,6 +208,19 @@ public partial class MainViewModel : ObservableObject
}
}
/// <summary>
/// Hide the main window.
/// </summary>
public void Hide()
{
MainWindowVisibility = false;
QueryText = "";
ActiveView = ActiveView.Results;
ContextMenu.Clear();
HideRequested?.Invoke();
Log.Info(ClassName, "Hide requested");
}
/// <summary>
/// Show the main window.
/// </summary>
@ -217,8 +230,8 @@ public partial class MainViewModel : ObservableObject
QueryText = "";
ActiveView = ActiveView.Results;
ContextMenu.Clear();
HideRequested?.Invoke();
Log.Info(ClassName, "Hide requested");
ShowRequested?.Invoke();
Log.Info(ClassName, "Show requested");
}
/// <summary>