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

    <Style x:Key="ChkMuteStyle" TargetType="{x:Type CheckBox}">
        <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
                                Grid.Row="1"
                                HorizontalAlignment="Center"
                                VerticalAlignment="Center"
                                FontSize="{TemplateBinding FontSize}"
                                Foreground="{TemplateBinding Foreground}"
                                Text="{TemplateBinding Content}" />
                        </Grid>
                    </Grid>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsChecked" Value="True">
                            <Setter TargetName="bdrMute" Property="Visibility" Value="Visible" />
                            <Setter TargetName="bdrUnMute" Property="Visibility" Value="Collapsed" />
                        </Trigger>
                        <Trigger Property="IsChecked" Value="False">
                            <Setter TargetName="bdrMute" Property="Visibility" Value="Collapsed" />
                            <Setter TargetName="bdrUnMute" Property="Visibility" 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>