45 lines
1.4 KiB
C#
45 lines
1.4 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Lattice.Themes.Fluent;
|
|
|
|
public class FluentThemePack : ThemePack
|
|
{
|
|
private static readonly Uri[] _lightResourceUris = new[]
|
|
{
|
|
new Uri("ms-appx:///Lattice.Themes.Fluent/Colors/Light.xaml"),
|
|
new Uri("ms-appx:///Lattice.Themes.Fluent/Main.xaml")
|
|
};
|
|
|
|
private static readonly Uri[] _darkResourceUris = new[]
|
|
{
|
|
new Uri("ms-appx:///Lattice.Themes.Fluent/Colors/Dark.xaml"),
|
|
new Uri("ms-appx:///Lattice.Themes.Fluent/Main.xaml")
|
|
};
|
|
|
|
public FluentThemePack(bool isDark = false) : base(isDark ? "Fluent Dark" : "Fluent")
|
|
{
|
|
Description = isDark ?
|
|
"Fluent UI 2 Dark Theme (WinUI 3)" :
|
|
"Fluent UI 2 Light Theme (WinUI 3)";
|
|
Version = "2.0.0";
|
|
IsDark = isDark;
|
|
}
|
|
|
|
public override IReadOnlyList<Uri> GetResourceUris()
|
|
{
|
|
return IsDark ? _darkResourceUris : _lightResourceUris;
|
|
}
|
|
|
|
public override void OnApply()
|
|
{
|
|
base.OnApply();
|
|
System.Diagnostics.Debug.WriteLine($"Applying Fluent UI 2 Theme: {Name}");
|
|
|
|
// Устанавливаем Fluent-специфичные настройки
|
|
if (Microsoft.UI.Xaml.Application.Current is Microsoft.UI.Xaml.Application app)
|
|
{
|
|
// Можно установить Fluent-специфичные настройки приложения
|
|
}
|
|
}
|
|
} |