Delay window show until plugins are initialized

- MainWindowVisibility starts as false (window hidden)
- Window IsVisible bound to MainWindowVisibility
- Set MainWindowVisibility = true in OnPluginsReady() after plugins load
This commit is contained in:
Hongtao Zhang 2026-01-15 23:31:30 -08:00
parent 5d80816f84
commit c68a03e193
2 changed files with 5 additions and 3 deletions

View file

@ -24,7 +24,8 @@
Background="Transparent" Background="Transparent"
ExtendClientAreaToDecorationsHint="True" ExtendClientAreaToDecorationsHint="True"
ExtendClientAreaChromeHints="NoChrome" ExtendClientAreaChromeHints="NoChrome"
SizeToContent="Height"> SizeToContent="Height"
IsVisible="{Binding MainWindowVisibility, Mode=TwoWay}">
<Window.Resources> <Window.Resources>
<converters:BoolToIsVisibleConverter x:Key="BoolToVisibilityConverter" /> <converters:BoolToIsVisibleConverter x:Key="BoolToVisibilityConverter" />

View file

@ -37,7 +37,7 @@ public partial class MainViewModel : ObservableObject
public event Action? ShowRequested; public event Action? ShowRequested;
[ObservableProperty] [ObservableProperty]
private bool _mainWindowVisibility = true; private bool _mainWindowVisibility = false;
[ObservableProperty] [ObservableProperty]
private string _queryText = string.Empty; private string _queryText = string.Empty;
@ -96,7 +96,8 @@ public partial class MainViewModel : ObservableObject
public void OnPluginsReady() public void OnPluginsReady()
{ {
_pluginsReady = true; _pluginsReady = true;
Log.Info(ClassName, "Plugins ready"); MainWindowVisibility = true;
Log.Info(ClassName, "Plugins ready - window shown");
if (!string.IsNullOrWhiteSpace(QueryText)) if (!string.IsNullOrWhiteSpace(QueryText))
_ = QueryAsync(); _ = QueryAsync();
} }