功能完善
This commit is contained in:
69
NeuWPF/NeoUI/Controls/Decorations/EmbossBorder.xaml.cs
Normal file
69
NeuWPF/NeoUI/Controls/Decorations/EmbossBorder.xaml.cs
Normal file
@@ -0,0 +1,69 @@
|
||||
namespace NeumUI.Controls.Decorations;
|
||||
|
||||
/// <summary>
|
||||
/// 浮雕边框
|
||||
/// </summary>
|
||||
public class EmbossBorder : DecorationBase
|
||||
{
|
||||
static EmbossBorder()
|
||||
{
|
||||
|
||||
DefaultStyleKeyProperty.OverrideMetadata(typeof(EmbossBorder),
|
||||
new FrameworkPropertyMetadata(typeof(EmbossBorder)));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置边框圆角的半径。
|
||||
/// </summary>
|
||||
public CornerRadius CornerRadius
|
||||
{
|
||||
get => (CornerRadius)GetValue(CornerRadiusProperty);
|
||||
set => SetValue(CornerRadiusProperty, value);
|
||||
}
|
||||
/// <summary>
|
||||
/// 高亮部分的画刷
|
||||
/// </summary>
|
||||
public SolidColorBrush LightShadowBrush
|
||||
{
|
||||
get => (SolidColorBrush)GetValue(LightShadowBrushProperty);
|
||||
set => SetValue(LightShadowBrushProperty, value);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 阴影部分的画刷
|
||||
/// </summary>
|
||||
public SolidColorBrush DarkShadowBrush
|
||||
{
|
||||
get => (SolidColorBrush)GetValue(DarkShadowBrushProperty);
|
||||
set => SetValue(DarkShadowBrushProperty, value);
|
||||
}
|
||||
|
||||
#region Dependency Properties
|
||||
|
||||
/// <summary>
|
||||
/// 表示边框圆角半径的依赖属性。
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty CornerRadiusProperty =
|
||||
DependencyProperty.Register(nameof(CornerRadius),
|
||||
typeof(CornerRadius), typeof(EmbossBorder),
|
||||
new PropertyMetadata(new CornerRadius(4)));
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用于浮雕边框的浅色阴影画刷。
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty LightShadowBrushProperty =
|
||||
DependencyProperty.Register(nameof(LightShadowBrush),
|
||||
typeof(SolidColorBrush), typeof(EmbossBorder),
|
||||
new PropertyMetadata(Brushes.WhiteSmoke));
|
||||
|
||||
/// <summary>
|
||||
/// 获取或设置用于浮雕边框的深色阴影画刷。
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty DarkShadowBrushProperty =
|
||||
DependencyProperty.Register(nameof(DarkShadowBrush),
|
||||
typeof(SolidColorBrush), typeof(EmbossBorder),
|
||||
new PropertyMetadata(Brushes.DarkGray));
|
||||
|
||||
#endregion
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user