-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathWindow1.xaml.cs
More file actions
30 lines (26 loc) · 992 Bytes
/
Window1.xaml.cs
File metadata and controls
30 lines (26 loc) · 992 Bytes
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
26
27
28
29
30
using Wpf.Ui.Appearance;
using Wpf.Ui.Controls;
namespace TEST_WPF
{
public partial class Window1 : FluentWindow
{
public Window1()
{
InitializeComponent();
}
private void FluentWindow_Loaded(object sender, System.Windows.RoutedEventArgs e)
{
ApplicationAccentColorManager.ApplySystemAccent();
ApplicationThemeManager.ApplySystemTheme();
Nav.Navigate("HomePage");
}
private void btnLightDarkSwitch_Click(object sender, System.Windows.RoutedEventArgs e)
{
ApplicationTheme currentAppTheme = ApplicationThemeManager.GetAppTheme();
if (currentAppTheme == ApplicationTheme.Dark)
ApplicationThemeManager.Apply(ApplicationTheme.Light, WindowBackdropType.None, updateAccent: true);
else
ApplicationThemeManager.Apply(ApplicationTheme.Dark, WindowBackdropType.None, updateAccent: true);
}
}
}