Files
ShrlAlgoToolkit/Melskin/Controls/Avatar.xaml.cs
2026-02-17 22:17:13 +08:00

41 lines
1.2 KiB
C#

namespace Melskin.Controls;
/// <summary>
/// 头像
/// </summary>
public class Avatar : ContentControl
{
/// <summary>
/// 圆角半径
/// </summary>
public static readonly DependencyProperty CornerRadiusProperty =
System.Windows.Controls.Border.CornerRadiusProperty
.AddOwner(
typeof(Avatar),
new FrameworkPropertyMetadata(default(CornerRadius), FrameworkPropertyMetadataOptions.Inherits));
/// <summary>
/// 伸展方式
/// </summary>
public static readonly DependencyProperty StretchProperty =
Viewbox.StretchProperty
.AddOwner(
typeof(Avatar),
new FrameworkPropertyMetadata(default(Stretch), FrameworkPropertyMetadataOptions.Inherits));
/// <summary>
/// 圆角半径
/// </summary>
public CornerRadius CornerRadius
{
get => (CornerRadius)GetValue(CornerRadiusProperty);
set => SetValue(CornerRadiusProperty, value);
}
/// <summary>
/// 伸展方式
/// </summary>
public Stretch Stretch { get => (Stretch)GetValue(StretchProperty); set => SetValue(StretchProperty, value); }
}