70 lines
4.1 KiB
XML
70 lines
4.1 KiB
XML
<ResourceDictionary
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:cvt="clr-namespace:NeumUI.Converters"
|
|
xmlns:internal="clr-namespace:NeumUI.Converters.Internal"
|
|
xmlns:svd="clr-namespace:NeumUI.Controls.Decorations"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
|
<Style TargetType="{x:Type svd:EmbossBorder}">
|
|
<Setter Property="Focusable" Value="False" />
|
|
<Setter Property="CornerRadius" Value="4" />
|
|
<Setter Property="Background" Value="{DynamicResource BackgroundLayoutBrush}" />
|
|
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
|
|
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
|
<Setter Property="VerticalContentAlignment" Value="Stretch" />
|
|
<Setter Property="Padding" Value="4" />
|
|
<Setter Property="FontSize" Value="14" />
|
|
<Setter Property="Intensity" Value="1" />
|
|
<Setter Property="LightShadowBrush" Value="{DynamicResource LightShadowBrush}" />
|
|
<Setter Property="DarkShadowBrush" Value="{DynamicResource DarkShadowBrush}" />
|
|
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type svd:EmbossBorder}">
|
|
<Grid>
|
|
<!-- 光影区域 -->
|
|
<!-- 默认4的边距显示光影效果 -->
|
|
<Grid Margin="4" Visibility="{TemplateBinding ShaderEnabled, Converter={x:Static cvt:BooleanToVisibilityConverter.CollapsedInstance}}">
|
|
<!-- 暗部 -->
|
|
<Border
|
|
Background="{TemplateBinding DarkShadowBrush}"
|
|
CornerRadius="{TemplateBinding CornerRadius}"
|
|
Margin="{TemplateBinding Intensity,
|
|
Converter={x:Static internal:IntensityToEmbossMarginRightBottomConverter.Instance}}"
|
|
x:Name="DarkBorder" />
|
|
<!-- 亮部 -->
|
|
<Border
|
|
Background="{TemplateBinding LightShadowBrush}"
|
|
CornerRadius="{TemplateBinding CornerRadius}"
|
|
Margin="{TemplateBinding Intensity,
|
|
Converter={x:Static internal:IntensityToEmbossMarginLeftTopConverter.Instance}}" />
|
|
<!-- 模糊效果 -->
|
|
<Grid.Effect>
|
|
<BlurEffect Radius="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Intensity, Converter={x:Static internal:IntensityToEmbossBlurConverter.Instance}, Mode=OneWay}" />
|
|
</Grid.Effect>
|
|
</Grid>
|
|
|
|
<!-- 内容区域 -->
|
|
<!-- 默认4的边距显示光影效果 -->
|
|
<Border
|
|
Background="{TemplateBinding Background}"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
CornerRadius="{TemplateBinding CornerRadius}"
|
|
Margin="4"
|
|
Padding="{TemplateBinding Padding}">
|
|
<ContentPresenter
|
|
Focusable="False"
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
RecognizesAccessKey="True"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
|
TextElement.Foreground="{TemplateBinding Foreground}"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
|
x:Name="contentPresenter" />
|
|
</Border>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</ResourceDictionary> |