Files
Shrlalgo.RvKits/NeuWPF/NeuWPF/Controls/Decorations/EmbossBorder.xaml.cs

63 lines
2.1 KiB
C#
Raw Normal View History

2025-08-12 23:08:54 +08:00
namespace NeuWPF.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
// Using a DependencyProperty as the backing store for CornerRadius.
public static readonly DependencyProperty CornerRadiusProperty =
DependencyProperty.Register(nameof(CornerRadius),
typeof(CornerRadius), typeof(EmbossBorder),
new PropertyMetadata(new CornerRadius(4)));
// Using a DependencyProperty as the backing store for LightShadowBrush.
public static readonly DependencyProperty LightShadowBrushProperty =
DependencyProperty.Register(nameof(LightShadowBrush),
typeof(SolidColorBrush), typeof(EmbossBorder),
new PropertyMetadata(Brushes.WhiteSmoke));
// Using a DependencyProperty as the backing store for DarkShadowBrush.
public static readonly DependencyProperty DarkShadowBrushProperty =
DependencyProperty.Register(nameof(DarkShadowBrush),
typeof(SolidColorBrush), typeof(EmbossBorder),
new PropertyMetadata(Brushes.DarkGray));
#endregion
}