Merge pull request #275 from irihitech/avatar

Add Avatar Control
This commit is contained in:
Dong Bin
2024-06-28 21:28:04 +08:00
committed by GitHub
15 changed files with 387 additions and 0 deletions

View File

@@ -0,0 +1,26 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Media;
namespace Ursa.Controls;
public class Avatar : Button
{
public static readonly StyledProperty<IImage?> SourceProperty = AvaloniaProperty.Register<Avatar, IImage?>(
nameof(Source));
public static readonly StyledProperty<object?> HoverMaskProperty = AvaloniaProperty.Register<Avatar, object?>(
nameof(HoverMask));
public IImage? Source
{
get => GetValue(SourceProperty);
set => SetValue(SourceProperty, value);
}
public object? HoverMask
{
get => GetValue(HoverMaskProperty);
set => SetValue(HoverMaskProperty, value);
}
}