A cross-platform UI framework for .NET
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

33 lines
844 B

using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.Styling;
namespace ControlCatalog.Pages
{
public partial class ThemePage : UserControl
{
public static ThemeVariant Pink { get; } = new("Pink", ThemeVariant.Light);
public ThemePage()
{
InitializeComponent();
Selector.ItemsSource = new[]
{
ThemeVariant.Default,
ThemeVariant.Dark,
ThemeVariant.Light,
Pink
};
Selector.SelectedIndex = 0;
Selector.SelectionChanged += (_, _) =>
{
if (Selector.SelectedItem is ThemeVariant theme)
{
ThemeVariantScope.RequestedThemeVariant = theme;
}
};
}
}
}