Skip to content

Commit f7ca16a

Browse files
committed
标题栏深浅色支持
1 parent f623e3d commit f7ca16a

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Utilities.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using Microsoft.UI;
22
using Microsoft.UI.Composition.SystemBackdrops;
3+
using Microsoft.UI.Windowing;
34
using Microsoft.UI.Xaml;
45
using Microsoft.UI.Xaml.Media;
56
using System;
@@ -47,6 +48,7 @@ public static void SetBackdrop(this Window window)
4748
public static void SetThemeColor(this Window window)
4849
{
4950
string appearance = App.settings.Appearance;
51+
window.AppWindow.TitleBar.PreferredTheme = Enum.Parse<TitleBarTheme>(appearance);
5052
if (window.Content is FrameworkElement rootElement)
5153
{
5254
rootElement.RequestedTheme = Enum.Parse<ElementTheme>(appearance);

0 commit comments

Comments
 (0)