功能更新
This commit is contained in:
40
Melskin/Controls/Avatar.xaml.cs
Normal file
40
Melskin/Controls/Avatar.xaml.cs
Normal file
@@ -0,0 +1,40 @@
|
||||
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); }
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user