62 lines
3.3 KiB
XML
62 lines
3.3 KiB
XML
<ResourceDictionary
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:controls="clr-namespace:NeoUI.Controls"
|
|
xmlns:ncd="clr-namespace:NeoUI.Controls.Decorations"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
|
|
|
|
|
<Style TargetType="{x:Type controls:Avatar}">
|
|
<Setter Property="Background" Value="{DynamicResource BackgroundLayoutBrush}" />
|
|
<Setter Property="BorderBrush" Value="{DynamicResource BorderNormalBrush}" />
|
|
<Setter Property="BorderThickness" Value="0" />
|
|
<Setter Property="SnapsToDevicePixels" Value="True" />
|
|
<Setter Property="CornerRadius" Value="20" />
|
|
<Setter Property="Width" Value="40" />
|
|
<Setter Property="Height" Value="{Binding Width, Mode=OneWay, RelativeSource={RelativeSource Self}}" />
|
|
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
|
<Setter Property="VerticalContentAlignment" Value="Center" />
|
|
<Setter Property="HorizontalAlignment" Value="Center" />
|
|
<Setter Property="VerticalAlignment" Value="Center" />
|
|
<Setter Property="Stretch" Value="Uniform" />
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="{x:Type controls:Avatar}">
|
|
<Grid>
|
|
<ncd:EmbossBorder Margin="-4" CornerRadius="{TemplateBinding CornerRadius}">
|
|
<!--<Grid>
|
|
<Grid.OpacityMask>
|
|
<VisualBrush Visual="{Binding ElementName=ClipMask}" />
|
|
</Grid.OpacityMask>
|
|
-->
|
|
<!-- 用于裁剪的蒙版 -->
|
|
<!--
|
|
<Border
|
|
x:Name="ClipMask"
|
|
Background="White"
|
|
CornerRadius="{TemplateBinding CornerRadius}" />
|
|
</Grid>-->
|
|
</ncd:EmbossBorder>
|
|
<ncd:SlotBorder Margin="-4"
|
|
Background="{TemplateBinding Background}"
|
|
BorderBrush="{TemplateBinding BorderBrush}"
|
|
BorderThickness="{TemplateBinding BorderThickness}"
|
|
CornerRadius="{TemplateBinding CornerRadius}"
|
|
Intensity="0.2"
|
|
Padding="{TemplateBinding Padding}"
|
|
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
|
|
<Viewbox Stretch="{TemplateBinding Stretch}">
|
|
<ContentPresenter
|
|
Focusable="False"
|
|
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
|
Margin="{TemplateBinding Padding}"
|
|
RecognizesAccessKey="True"
|
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
|
|
</Viewbox>
|
|
</ncd:SlotBorder>
|
|
</Grid>
|
|
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
</ResourceDictionary> |