Newer
Older
Correlator / PipeGallery / Style / CheckBox.xaml
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:converter="clr-namespace:LenovoOKM.Converter"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Style TargetType="{x:Type CheckBox}" x:Key="CheckBoxStyle">
        <Setter Property="Margin" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type CheckBox}">
                    <StackPanel SnapsToDevicePixels="true" Margin="0" Orientation="Horizontal">
                        <Image x:Name="img" Height="16" Width="16" Stretch="Fill" Source="/PipeGallery;component/Image/uncheck.png"/>
                        <TextBlock Margin="8,0,0,0" VerticalAlignment="Center" x:Name="txt" Text="{TemplateBinding Content}" FontSize="16" Foreground="{TemplateBinding Foreground}"/>
                    </StackPanel>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Source" TargetName="img" Value="/PipeGallery;component/Image/checked.png"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

    <Style TargetType="{x:Type CheckBox}" x:Key="ChkMuteStyle">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="Height" Value="100"/>
        <Setter Property="Width" Value="80"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="Foreground" Value="#989898"/>
        <Setter Property="FontSize" Value="14"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type CheckBox}">
                    <Grid>
                        <Grid Width="80" Height="100" >
                            <Grid.RowDefinitions>
                                <RowDefinition Height="4*"/>
                                <RowDefinition Height="*"/>
                            </Grid.RowDefinitions>
                            <Border x:Name="bdr" Grid.Row="0" Width="63" Height="63" >
                                <Border.Background>
                                    <ImageBrush ImageSource="/PipeGallery;component/Image/btn_icon2.png" />
                                </Border.Background>
                                <Grid>
                                    <Border x:Name="bdrMute" Width="29" Height="26">
                                        <Border.Background>
                                            <ImageBrush ImageSource="/PipeGallery;component/Image/t_icon3.png" />
                                        </Border.Background>
                                    </Border>
                                    <Border x:Name="bdrUnMute" Width="29" Height="26">
                                        <Border.Background>
                                            <ImageBrush ImageSource="/PipeGallery;component/Image/t_icon6.png" />
                                        </Border.Background>
                                    </Border>
                                </Grid>
                            </Border>
                            <TextBlock  Text="{TemplateBinding Content}" FontSize="{TemplateBinding FontSize}"  Foreground="{TemplateBinding Foreground}" 
                                        Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center"  />
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter Property="Visibility" TargetName="bdrMute" Value="Visible"/>
                            <Setter Property="Visibility" TargetName="bdrUnMute" Value="Collapsed"/>
                        </Trigger>
                        <Trigger Property="IsChecked" Value="False">
                            <Setter Property="Visibility" TargetName="bdrMute" Value="Collapsed"/>
                            <Setter Property="Visibility" TargetName="bdrUnMute" Value="Visible"/>
                        </Trigger>
                        <Trigger  Property="IsMouseOver" Value="true">
                            <Setter TargetName="bdr" Property="Background">
                                <Setter.Value>
                                    <ImageBrush ImageSource="/PipeGallery;component/Image/btn_icon02.png" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                        <Trigger  Property="Tag" Value="1">
                            <Setter TargetName="bdr" Property="Background">
                                <Setter.Value>
                                    <ImageBrush ImageSource="/PipeGallery;component/Image/btn_icon1.png" />
                                </Setter.Value>
                            </Setter>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>