We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 86ae89a commit dac4af0Copy full SHA for dac4af0
src/DotVast.HashTool.WinUI/Services/Settings/AppearanceSettingsService.cs
@@ -23,7 +23,7 @@ public override async Task InitializeAsync()
23
? AppLanguage.System
24
: WGAL.PrimaryLanguageOverride.ToAppLanguage();
25
26
- SetTheme(); // 在初始化时就设置主题
+ await InitializeTheme();
27
await Task.CompletedTask;
28
}
29
@@ -78,6 +78,17 @@ private void SetTheme()
78
79
TitleBarContextMenuHelper.UpdateTitleBarContextMenu(Theme);
80
81
+ private async Task InitializeTheme()
82
+ {
83
+ if (App.MainWindow.Content is FrameworkElement rootElement)
84
85
+ while (!rootElement.IsLoaded)
86
87
+ await Task.Delay(25);
88
+ }
89
90
+ SetTheme();
91
92
#endregion Theme
93
94
#region Language
0 commit comments