-
-
Notifications
You must be signed in to change notification settings - Fork 2
/
App.xaml.cs
25 lines (18 loc) · 1.1 KB
/
App.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
using System;
using System.Windows;
using Dark.Net;
namespace darknet_demo_wpf;
public partial class App {
protected override void OnStartup(StartupEventArgs e) {
const Theme processTheme = Theme.Auto;
IDarkNet darkNet = DarkNet.Instance;
darkNet.SetCurrentProcessTheme(processTheme);
Console.WriteLine($"Process theme is {processTheme}");
Console.WriteLine($"System theme is {(darkNet.UserDefaultAppThemeIsDark ? "Dark" : "Light")}");
Console.WriteLine($"Taskbar theme {(darkNet.UserTaskbarThemeIsDark ? "Dark" : "Light")}");
// new SkinManager().RegisterSkins(new Uri("Skins/Skin.Light.xaml", UriKind.Relative), new Uri("Skins/Skin.Dark.xaml", UriKind.Relative));
darkNet.UserDefaultAppThemeIsDarkChanged += (_, isSystemDarkTheme) => { Console.WriteLine($"System theme is {(isSystemDarkTheme ? "Dark" : "Light")}"); };
darkNet.UserTaskbarThemeIsDarkChanged += (_, isTaskbarDarkTheme) => { Console.WriteLine($"Taskbar theme is {(isTaskbarDarkTheme ? "Dark" : "Light")}"); };
base.OnStartup(e);
}
}