| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102 |
- <ResourceDictionary
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:ZUI="clr-namespace:CustomUI">
- <Style TargetType="{x:Type ZUI:ZCheckBox}">
- <Setter Property="FocusVisualStyle" Value="{x:Null}" />
- <Setter Property="Background" Value="White" />
- <Setter Property="BorderBrush" Value="#CED9E8" />
- <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
- <Setter Property="BorderThickness" Value="1" />
- <Setter Property="SnapsToDevicePixels" Value="True" />
- <Setter Property="CornerRadius" Value="2" />
- <Setter Property="UseLayoutRounding" Value="True" />
- <Setter Property="VerticalContentAlignment" Value="Center" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ZUI:ZCheckBox}">
- <Grid
- x:Name="templateRoot"
- Background="Transparent"
- SnapsToDevicePixels="True">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Border
- x:Name="checkBoxBorder"
- Width="16"
- Height="15"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Background="{TemplateBinding Background}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="{TemplateBinding BorderThickness}"
- CornerRadius="{TemplateBinding CornerRadius}"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
- UseLayoutRounding="{TemplateBinding UseLayoutRounding}">
- <Grid
- x:Name="markGrid"
- HorizontalAlignment="Center"
- VerticalAlignment="Center">
- <Path
- x:Name="optionMark"
- Width="10"
- Margin="0"
- Data="F1M9.97498,1.22334L4.6983,9.09834 4.52164,9.09834 0,5.19331 1.27664,3.52165 4.255,6.08833 8.33331,1.52588E-05 9.97498,1.22334z"
- Fill="#00FFFFFF"
- Stretch="Uniform" />
- <Rectangle
- x:Name="indeterminateMark"
- Margin="2"
- Fill="#FF212121"
- Opacity="0" />
- </Grid>
- </Border>
- <ContentPresenter
- x:Name="contentPresenter"
- Grid.Column="1"
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Content="{TemplateBinding Content}"
- ContentStringFormat="{TemplateBinding ContentStringFormat}"
- ContentTemplate="{TemplateBinding ContentTemplate}"
- Focusable="False"
- RecognizesAccessKey="True"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="HasContent" Value="True">
- <Setter Property="Padding" Value="4,0,0,0" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="True">
- <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="#6452A4" />
- <Setter TargetName="indeterminateMark" Property="Fill" Value="#FF212121" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="False">
- <Setter TargetName="checkBoxBorder" Property="Background" Value="#FFE6E6E6" />
- <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="#FFBCBCBC" />
- <Setter TargetName="optionMark" Property="Fill" Value="#FF707070" />
- <Setter TargetName="indeterminateMark" Property="Fill" Value="#FF707070" />
- </Trigger>
- <Trigger Property="IsPressed" Value="True">
- <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="#6452A4" />
- <Setter TargetName="indeterminateMark" Property="Fill" Value="#FF212121" />
- </Trigger>
- <Trigger Property="IsChecked" Value="True">
- <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="#6452A4" />
- <Setter TargetName="checkBoxBorder" Property="Background" Value="#6452A4" />
- <Setter TargetName="optionMark" Property="Fill" Value="#FFFFFF" />
- <Setter TargetName="indeterminateMark" Property="Opacity" Value="0" />
- </Trigger>
- <Trigger Property="IsChecked" Value="{x:Null}">
- <Setter TargetName="optionMark" Property="Opacity" Value="0" />
- <Setter TargetName="indeterminateMark" Property="Opacity" Value="1" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|