2024-08-20 20:53:00 +08:00
|
|
|
|
using System.Globalization;
|
2024-09-12 00:28:07 +08:00
|
|
|
|
using AtomUI.Controls;
|
2024-09-03 12:00:24 +08:00
|
|
|
|
using AtomUI.Utils;
|
2024-08-20 20:53:00 +08:00
|
|
|
|
using Avalonia;
|
2024-06-19 18:46:29 +08:00
|
|
|
|
|
2024-07-30 00:14:36 +08:00
|
|
|
|
namespace AtomUI.Theme;
|
2024-06-19 18:46:29 +08:00
|
|
|
|
|
|
|
|
|
public static class AtomUIExtensions
|
|
|
|
|
{
|
2024-09-12 00:28:07 +08:00
|
|
|
|
public static AppBuilder ConfigureAtomUI(this AppBuilder builder)
|
|
|
|
|
{
|
|
|
|
|
builder.AfterSetup(builder =>
|
|
|
|
|
{
|
|
|
|
|
var themeManager = ThemeManager.Current;
|
|
|
|
|
themeManager.ConfigureAtomUIControls();
|
|
|
|
|
themeManager.Configure();
|
|
|
|
|
});
|
|
|
|
|
return builder;
|
|
|
|
|
}
|
|
|
|
|
|
2024-09-10 00:09:07 +08:00
|
|
|
|
public static AppBuilder UseAtomUI(this AppBuilder builder)
|
|
|
|
|
{
|
|
|
|
|
builder.AfterSetup(builder =>
|
|
|
|
|
{
|
|
|
|
|
var themeManager = ThemeManager.Current;
|
2024-09-12 15:09:27 +08:00
|
|
|
|
themeManager.CultureInfo = new CultureInfo(LanguageCode.en_US);
|
2024-09-10 00:09:07 +08:00
|
|
|
|
themeManager.LoadTheme(ThemeManager.DEFAULT_THEME_ID);
|
|
|
|
|
themeManager.SetActiveTheme(ThemeManager.DEFAULT_THEME_ID);
|
|
|
|
|
builder.Instance!.Styles.Add(themeManager);
|
|
|
|
|
});
|
|
|
|
|
return builder;
|
|
|
|
|
}
|
2024-06-19 18:46:29 +08:00
|
|
|
|
}
|