39 lines
2.6 KiB
XML
39 lines
2.6 KiB
XML
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:hc="clr-namespace:HandyControl.Controls"
|
|
xmlns:themes="clr-namespace:HandyControl.Themes">
|
|
|
|
<ResourceDictionary.MergedDictionaries>
|
|
<themes:SharedResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Styles/Base/BaseStyle.xaml" />
|
|
<themes:SharedResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Basic/Converters.xaml" />
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
|
<Style x:Key="ShieldBaseStyle" BasedOn="{StaticResource BaseStyle}" TargetType="hc:Shield">
|
|
<Setter Property="Height" Value="20"/>
|
|
<Setter Property="Foreground" Value="{DynamicResource TextIconBrush}"/>
|
|
<Setter Property="hc:BorderElement.CornerRadius" Value="3"/>
|
|
<Setter Property="BorderThickness" Value="0"/>
|
|
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
|
<Setter Property="Color" Value="{DynamicResource PrimaryBrush}"/>
|
|
<Setter Property="Template">
|
|
<Setter.Value>
|
|
<ControlTemplate TargetType="hc:Shield">
|
|
<Grid>
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="Auto"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<Border Grid.Column="0" Background="#555" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource CornerRadiusSplitConverter},ConverterParameter='1,0,0,1'}">
|
|
<TextBlock Text="{TemplateBinding Subject}" VerticalAlignment="Center" Margin="4,0"/>
|
|
</Border>
|
|
<Border Grid.Column="1" Background="{TemplateBinding Color}" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource CornerRadiusSplitConverter},ConverterParameter='0,1,1,0'}">
|
|
<ContentPresenter ContentSource="Status" VerticalAlignment="Center" Margin="4,0" TextElement.Foreground="{TemplateBinding Foreground}" ContentStringFormat="{TemplateBinding ContentStringFormat}"/>
|
|
</Border>
|
|
</Grid>
|
|
</ControlTemplate>
|
|
</Setter.Value>
|
|
</Setter>
|
|
</Style>
|
|
|
|
</ResourceDictionary>
|