2023-02-13 02:17:38 +08:00
|
|
|
using System.Collections;
|
|
|
|
using Avalonia;
|
|
|
|
using Avalonia.Controls.Primitives;
|
|
|
|
|
|
|
|
namespace Semi.Avalonia.Demo.Controls;
|
|
|
|
|
|
|
|
public class FunctionalColorGroupControl: TemplatedControl
|
|
|
|
{
|
|
|
|
public static readonly StyledProperty<string?> TitleProperty = AvaloniaProperty.Register<FunctionalColorGroupControl, string?>(
|
|
|
|
nameof(Title));
|
|
|
|
public string? Title
|
|
|
|
{
|
|
|
|
get => GetValue(TitleProperty);
|
|
|
|
set => SetValue(TitleProperty, value);
|
|
|
|
}
|
|
|
|
|
2023-03-26 19:38:12 +08:00
|
|
|
public static readonly DirectProperty<FunctionalColorGroupControl, IEnumerable?> LightColorsProperty = AvaloniaProperty.RegisterDirect<FunctionalColorGroupControl, IEnumerable?>(
|
2023-02-13 02:17:38 +08:00
|
|
|
nameof(LightColors), o => o.LightColors, (o, v) => o.LightColors = v);
|
2023-03-26 19:38:12 +08:00
|
|
|
private IEnumerable? _lightColors;
|
|
|
|
public IEnumerable? LightColors
|
2023-02-13 02:17:38 +08:00
|
|
|
{
|
|
|
|
get => _lightColors;
|
|
|
|
set => SetAndRaise(LightColorsProperty, ref _lightColors, value);
|
|
|
|
}
|
|
|
|
|
2023-03-26 19:38:12 +08:00
|
|
|
public static readonly DirectProperty<FunctionalColorGroupControl, IEnumerable?> DarkColorsProperty = AvaloniaProperty.RegisterDirect<FunctionalColorGroupControl, IEnumerable?>(
|
2023-02-13 02:17:38 +08:00
|
|
|
nameof(DarkColors), o => o.DarkColors, (o, v) => o.DarkColors = v);
|
2023-03-26 19:38:12 +08:00
|
|
|
private IEnumerable? _darkColors;
|
|
|
|
public IEnumerable? DarkColors
|
2023-02-13 02:17:38 +08:00
|
|
|
{
|
|
|
|
get => _darkColors;
|
|
|
|
set => SetAndRaise(DarkColorsProperty, ref _darkColors, value);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
}
|