mirror of
https://gitee.com/chinware/atomui.git
synced 2024-11-29 18:38:16 +08:00
33 lines
954 B
C#
33 lines
954 B
C#
using System.Globalization;
|
|
using AtomUI.Controls;
|
|
using AtomUI.Utils;
|
|
using Avalonia;
|
|
|
|
namespace AtomUI.Theme;
|
|
|
|
public static class AtomUIExtensions
|
|
{
|
|
public static AppBuilder ConfigureAtomUI(this AppBuilder builder)
|
|
{
|
|
builder.AfterSetup(builder =>
|
|
{
|
|
var themeManager = ThemeManager.Current;
|
|
themeManager.ConfigureAtomUIControls();
|
|
themeManager.Configure();
|
|
});
|
|
return builder;
|
|
}
|
|
|
|
public static AppBuilder UseAtomUI(this AppBuilder builder)
|
|
{
|
|
builder.AfterSetup(builder =>
|
|
{
|
|
var themeManager = ThemeManager.Current;
|
|
themeManager.CultureInfo = new CultureInfo(LanguageCode.en_US);
|
|
themeManager.LoadTheme(ThemeManager.DEFAULT_THEME_ID);
|
|
themeManager.SetActiveTheme(ThemeManager.DEFAULT_THEME_ID);
|
|
builder.Instance!.Styles.Add(themeManager);
|
|
});
|
|
return builder;
|
|
}
|
|
} |