detect/detect.gui/Controls/StateItem.axaml.cs
2024-11-13 17:09:15 +08:00

35 lines
872 B
C#

using Avalonia;
using Avalonia.Controls;
using Avalonia.Markup.Xaml;
using Avalonia.Media;
namespace detect.gui.Controls;
public partial class StateItem : UserControl
{
public static readonly StyledProperty<string> TextProperty =
AvaloniaProperty.Register<StateItem, string>(nameof(Text));
public string Text
{
get => GetValue(TextProperty);
set => SetValue(TextProperty, value);
}
public static readonly StyledProperty<IBrush?> ItemColorProperty =
AvaloniaProperty.Register<StateItem, IBrush?>(nameof(ItemColor));
public IBrush? ItemColor
{
get => GetValue(ItemColorProperty);
set => SetValue(ItemColorProperty, value);
}
public StateItem()
{
InitializeComponent();
}
private void InitializeComponent()
{
AvaloniaXamlLoader.Load(this);
}
}