重命名
This commit is contained in:
71
NeoUI/Melskin/Controls/Label.xaml
Normal file
71
NeoUI/Melskin/Controls/Label.xaml
Normal file
@@ -0,0 +1,71 @@
|
||||
<ResourceDictionary
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:assists="clr-namespace:VariaStudio.Assists"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
<!-- 标签对象 -->
|
||||
<Style TargetType="{x:Type Label}" x:Key="BasicLabelStyle">
|
||||
<Setter Property="Background" Value="{DynamicResource ControlBackgroundNormalBrush}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource TextPrimaryBrush}" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="assists:ShadingAssist.DisabledForeground" Value="{DynamicResource TextDisabledBrush}" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="Margin" Value="4" />
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="Padding" Value="20,8" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Label}">
|
||||
<Border
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="4"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
SnapsToDevicePixels="true"
|
||||
x:Name="contentBorder">
|
||||
<ContentPresenter
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
RecognizesAccessKey="True"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
TextElement.Foreground="{TemplateBinding Foreground}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
x:Name="contentPresenter" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{Binding Path=(assists:ShadingAssist.DisabledForeground), RelativeSource={RelativeSource TemplatedParent}}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style BasedOn="{StaticResource BasicLabelStyle}" TargetType="{x:Type Label}" />
|
||||
|
||||
<Style
|
||||
BasedOn="{StaticResource BasicLabelStyle}"
|
||||
TargetType="{x:Type Label}"
|
||||
x:Key="LabelPrimary">
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryNormalBrush}" />
|
||||
<Setter Property="assists:ShadingAssist.DisabledForeground" Value="{DynamicResource PrimaryDisabledBrush}" />
|
||||
</Style>
|
||||
|
||||
<Style
|
||||
BasedOn="{StaticResource BasicLabelStyle}"
|
||||
TargetType="{x:Type Label}"
|
||||
x:Key="LabelDanger">
|
||||
<Setter Property="Foreground" Value="{DynamicResource ErrorBrush}" />
|
||||
<Setter Property="assists:ShadingAssist.DisabledForeground" Value="{DynamicResource ErrorDisabledBrush}" />
|
||||
</Style>
|
||||
|
||||
<Style
|
||||
BasedOn="{StaticResource BasicLabelStyle}"
|
||||
TargetType="{x:Type Label}"
|
||||
x:Key="LabelSuccess">
|
||||
<Setter Property="Foreground" Value="{DynamicResource SuccessBrush}" />
|
||||
<Setter Property="assists:ShadingAssist.DisabledForeground" Value="{DynamicResource SuccessDisabledBrush}" />
|
||||
</Style>
|
||||
</ResourceDictionary>
|
||||
Reference in New Issue
Block a user