feat: initial DualBadge.
This commit is contained in:
53
src/Ursa/Controls/DualBadge.cs
Normal file
53
src/Ursa/Controls/DualBadge.cs
Normal file
@@ -0,0 +1,53 @@
|
||||
using Avalonia;
|
||||
using Avalonia.Controls.Metadata;
|
||||
using Avalonia.Controls.Presenters;
|
||||
using Avalonia.Controls.Primitives;
|
||||
using Avalonia.Controls.Templates;
|
||||
using Avalonia.Media;
|
||||
|
||||
namespace Ursa.Controls;
|
||||
|
||||
[TemplatePart(PART_Icon, typeof(ContentPresenter))]
|
||||
public class DualBadge : HeaderedContentControl
|
||||
{
|
||||
public const string PART_HeaderPresenter = "PART_HeaderPresenter";
|
||||
public const string PART_ContentPresenter = "PART_ContentPresenter";
|
||||
public const string PART_Icon = "PART_Icon";
|
||||
|
||||
public static readonly StyledProperty<object?> IconProperty =
|
||||
AvaloniaProperty.Register<DualBadge, object?>(nameof(Icon));
|
||||
|
||||
public object? Icon
|
||||
{
|
||||
get => GetValue(IconProperty);
|
||||
set => SetValue(IconProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<IDataTemplate?> IconTemplateProperty =
|
||||
AvaloniaProperty.Register<DualBadge, IDataTemplate?>(nameof(IconTemplate));
|
||||
|
||||
public IDataTemplate? IconTemplate
|
||||
{
|
||||
get => GetValue(IconTemplateProperty);
|
||||
set => SetValue(IconTemplateProperty, value);
|
||||
}
|
||||
|
||||
|
||||
public static readonly StyledProperty<IBrush?> HeaderForegroundProperty =
|
||||
AvaloniaProperty.Register<DualBadge, IBrush?>(nameof(HeaderForeground));
|
||||
|
||||
public IBrush? HeaderForeground
|
||||
{
|
||||
get => GetValue(HeaderForegroundProperty);
|
||||
set => SetValue(HeaderForegroundProperty, value);
|
||||
}
|
||||
|
||||
public static readonly StyledProperty<IBrush?> HeaderBackgroundProperty =
|
||||
AvaloniaProperty.Register<DualBadge, IBrush?>(nameof(HeaderBackground));
|
||||
|
||||
public IBrush? HeaderBackground
|
||||
{
|
||||
get => GetValue(HeaderBackgroundProperty);
|
||||
set => SetValue(HeaderBackgroundProperty, value);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user