feat: Add Shield styles and demos.
This commit is contained in:
1 parent
905bc92825
commit
7b0e9ba108
7 files changed
+136
-9
No files matched your search
@@ -0,0 +1,40 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls;
|
||||
using Avalonia.Media;
|
||||
using Avalonia.Metadata;
|
||||
|
||||
namespace HandyControl.Controls;
|
||||
|
||||
/// <summary>
|
||||
/// 徽章
|
||||
/// </summary>
|
||||
public class Shield : Button
|
||||
{
|
||||
public static readonly StyledProperty<string?> SubjectProperty =
|
||||
AvaloniaProperty.Register<Shield, string?>(nameof(Subject));
|
||||
|
||||
public string? Subject
|
||||
{
|
||||
get => GetValue(SubjectProperty);
|
||||
set => SetValue(SubjectProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<object?> StatusProperty =
|
||||
AvaloniaProperty.Register<Shield, object?>(nameof(Status));
|
||||
|
||||
[Content]
|
||||
public object? Status
|
||||
{
|
||||
get => GetValue(StatusProperty);
|
||||
set => SetValue(StatusProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<IBrush?> ColorProperty =
|
||||
AvaloniaProperty.Register<Shield, IBrush?>(nameof(Color));
|
||||
|
||||
public IBrush? Color
|
||||
{
|
||||
get => GetValue(ColorProperty);
|
||||
set => SetValue(ColorProperty, value);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user