123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177 |
- <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
- <Style x:Key="OptionMarkFocusVisual">
- <Setter Property="Control.Template">
- <Setter.Value>
- <ControlTemplate>
- <Rectangle
- Margin="14,0,0,0"
- SnapsToDevicePixels="true"
- Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
- StrokeDashArray="1 2"
- StrokeThickness="1" />
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- <SolidColorBrush x:Key="OptionMark.Static.Background" Color="#FFFFFFFF" />
- <SolidColorBrush x:Key="OptionMark.Static.Border" Color="#FF707070" />
- <SolidColorBrush x:Key="OptionMark.MouseOver.Background" Color="White" />
- <SolidColorBrush x:Key="OptionMark.MouseOver.Border" Color="Black" />
- <SolidColorBrush x:Key="OptionMark.MouseOver.Glyph" Color="White" />
- <SolidColorBrush x:Key="OptionMark.Disabled.Background" Color="#FFE6E6E6" />
- <SolidColorBrush x:Key="OptionMark.Disabled.Border" Color="#FFBCBCBC" />
- <SolidColorBrush x:Key="OptionMark.Disabled.Glyph" Color="#FF707070" />
- <SolidColorBrush x:Key="OptionMark.Pressed.Background" Color="#FFD9ECFF" />
- <SolidColorBrush x:Key="OptionMark.Pressed.Border" Color="#FF3C77DD" />
- <SolidColorBrush x:Key="OptionMark.Pressed.Glyph" Color="White" />
- <SolidColorBrush x:Key="OptionMark.Static.Glyph" Color="White" />
- <ControlTemplate x:Key="MenuCheckbox" TargetType="{x:Type CheckBox}">
- <Grid
- x:Name="templateRoot"
- Background="Transparent"
- SnapsToDevicePixels="True">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Border
- x:Name="checkBoxBorder"
- Width="20"
- Height="20"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- BorderBrush="{TemplateBinding BorderBrush}"
- BorderThickness="1">
- <Grid x:Name="markGrid">
- <Polygon
- x:Name="optionMark"
- Width="20"
- Height="20"
- Margin="1,0,0,0"
- VerticalAlignment="Center"
- Fill="{StaticResource OptionMark.Static.Glyph}"
- Opacity="0"
- Points="15.5992424 4.59619408 16.3063492 5.30330086 5.69974747 15.9099026 0.396446609 10.6066017 1.10355339 9.89949494 5.7 14.496" />
- <Rectangle
- x:Name="indeterminateMark"
- Width="20"
- Height="20"
- Fill="{StaticResource OptionMark.Static.Glyph}"
- Opacity="0" />
- </Grid>
- </Border>
- <ContentPresenter
- x:Name="contentPresenter"
- Grid.Column="1"
- Margin="{TemplateBinding Padding}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- Focusable="False"
- RecognizesAccessKey="True"
- SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="HasContent" Value="true">
- <Setter Property="FocusVisualStyle" Value="{StaticResource OptionMarkFocusVisual}" />
- <Setter Property="Padding" Value="4,-1,0,0" />
- </Trigger>
- <Trigger Property="IsMouseOver" Value="true">
- <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource OptionMark.MouseOver.Background}" />
- <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource OptionMark.MouseOver.Border}" />
- <Setter TargetName="checkBoxBorder" Property="BorderThickness" Value="2" />
- <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource OptionMark.MouseOver.Glyph}" />
- <Setter TargetName="indeterminateMark" Property="Fill" Value="{StaticResource OptionMark.MouseOver.Glyph}" />
- </Trigger>
- <Trigger Property="IsEnabled" Value="false">
- <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource OptionMark.Disabled.Background}" />
- <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource OptionMark.Disabled.Border}" />
- <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource OptionMark.Disabled.Glyph}" />
- <Setter TargetName="indeterminateMark" Property="Fill" Value="{StaticResource OptionMark.Disabled.Glyph}" />
- </Trigger>
- <Trigger Property="IsPressed" Value="true">
- <Setter TargetName="checkBoxBorder" Property="Background" Value="{StaticResource OptionMark.Pressed.Background}" />
- <Setter TargetName="checkBoxBorder" Property="BorderBrush" Value="{StaticResource OptionMark.Pressed.Border}" />
- <Setter TargetName="optionMark" Property="Fill" Value="{StaticResource OptionMark.Pressed.Glyph}" />
- <Setter TargetName="indeterminateMark" Property="Fill" Value="{StaticResource OptionMark.Pressed.Glyph}" />
- </Trigger>
- <Trigger Property="IsChecked" Value="true">
- <Setter TargetName="optionMark" Property="Opacity" Value="1" />
- <Setter TargetName="indeterminateMark" Property="Opacity" Value="0" />
- <Setter TargetName="checkBoxBorder" Property="Background" Value="#FF0078D7" />
- </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>
- <Style x:Key="EditToolsCheckBoxStyle" TargetType="{x:Type CheckBox}">
- <Setter Property="SnapsToDevicePixels" Value="true" />
- <Setter Property="OverridesDefaultStyle" Value="False" />
- <Setter Property="Height" Value="22" />
- <Setter Property="IsChecked" Value="False" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="CheckBox">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="Auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Grid Width="{TemplateBinding Height}" Height="{TemplateBinding Height}">
- <Rectangle
- x:Name="CheckBoxRectangle"
- Fill="White"
- Opacity="0.3"
- RadiusX="2"
- RadiusY="2" />
- <Rectangle
- x:Name="CheckBoxRectangleOut"
- RadiusX="1"
- RadiusY="2"
- Stroke="Black"
- StrokeThickness="1" />
- <Grid
- x:Name="CheckedMark"
- Width="20"
- Height="20"
- Visibility="Collapsed">
- <Path
- Data="M1,9 L10,17"
- SnapsToDevicePixels="False"
- Stroke="White"
- StrokeThickness="3" />
- <Path
- Data="M8,17 L20,4"
- SnapsToDevicePixels="False"
- Stroke="White"
- StrokeThickness="3" />
- </Grid>
- </Grid>
- <TextBlock
- Grid.Column="1"
- Margin="14,0,0,0"
- VerticalAlignment="Center"
- FontSize="18"
- Foreground="Black"
- Text="{Binding Content, RelativeSource={RelativeSource TemplatedParent}}" />
- </Grid>
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="True">
- <Setter TargetName="CheckedMark" Property="Visibility" Value="Visible" />
- <Setter TargetName="CheckBoxRectangle" Property="Fill" Value="#FF00A8E0" />
- <Setter TargetName="CheckBoxRectangle" Property="Opacity" Value="1" />
- <Setter TargetName="CheckBoxRectangleOut" Property="Stroke" Value="Transparent" />
- <Setter TargetName="CheckedMark" Property="Visibility" Value="Visible" />
- <Setter TargetName="CheckBoxRectangle" Property="Fill" Value="#000000" />
- <Setter TargetName="CheckBoxRectangle" Property="Opacity" Value="1" />
- <Setter TargetName="CheckBoxRectangleOut" Property="Stroke" Value="Transparent" />
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
- </ResourceDictionary>
|