feat: Add banner infra.

This commit is contained in:
rabbitism
2023-02-10 16:46:45 +08:00
parent 273834a967
commit e137adce02
17 changed files with 134 additions and 45 deletions

View File

@@ -0,0 +1,44 @@
using Avalonia;
using Avalonia.Controls;
namespace Ursa.Controls;
public enum BannerType
{
None,
Info,
Warning,
Danger,
Success,
}
public class Banner: ContentControl
{
public static readonly StyledProperty<bool> CanCloseProperty = AvaloniaProperty.Register<Banner, bool>(
nameof(CanClose));
public bool CanClose
{
get => GetValue(CanCloseProperty);
set => SetValue(CanCloseProperty, value);
}
public static readonly StyledProperty<bool> ShowIconProperty = AvaloniaProperty.Register<Banner, bool>(
nameof(ShowIcon));
public bool ShowIcon
{
get => GetValue(ShowIconProperty);
set => SetValue(ShowIconProperty, value);
}
public static readonly StyledProperty<object?> HeaderProperty = AvaloniaProperty.Register<Banner, object?>(
nameof(Header));
public object? Header
{
get => GetValue(HeaderProperty);
set => SetValue(HeaderProperty, value);
}
}