48 lines
1.3 KiB
C#
48 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
using System.Windows;
|
|
using System.Windows.Controls;
|
|
using System.Windows.Data;
|
|
using System.Windows.Documents;
|
|
using System.Windows.Input;
|
|
using System.Windows.Media;
|
|
using System.Windows.Media.Imaging;
|
|
using System.Windows.Shapes;
|
|
|
|
using Wpf.Ui;
|
|
using Wpf.Ui.Appearance;
|
|
|
|
namespace RvAddinTest;
|
|
/// <summary>
|
|
/// FluentWindow.xaml 的交互逻辑
|
|
/// </summary>
|
|
public partial class FluentWindow
|
|
{
|
|
public FluentWindow()
|
|
{
|
|
InitializeComponent();
|
|
ApplicationThemeManager.Apply(this);
|
|
ApplicationThemeManager.Changed -= ApplicationThemeManager_Changed;
|
|
ApplicationThemeManager.Changed += ApplicationThemeManager_Changed;
|
|
}
|
|
private void ApplicationThemeManager_Changed(ApplicationTheme currentApplicationTheme, Color systemAccent)
|
|
{
|
|
ApplicationThemeManager.Apply(this);
|
|
}
|
|
|
|
private void Button_Click(object sender, RoutedEventArgs e)
|
|
{
|
|
if (ApplicationThemeManager.GetAppTheme() == ApplicationTheme.Light)
|
|
{
|
|
ApplicationThemeManager.Apply(ApplicationTheme.Dark);
|
|
}
|
|
else
|
|
{
|
|
ApplicationThemeManager.Apply(ApplicationTheme.Light);
|
|
}
|
|
}
|
|
}
|