aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch/Controls/TouchCheckBox.xaml
blob: 3ece097fa81917738f9e118fc7fd69967e52c79c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:components="clr-namespace:Tango.Touch.Components"
                    xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
                    xmlns:fa="http://schemas.fontawesome.io/icons/"
                    xmlns:local="clr-namespace:Tango.Touch.Controls">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="../Resources/Colors.xaml" />
        <ResourceDictionary>
            <BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
        </ResourceDictionary>
    </ResourceDictionary.MergedDictionaries>

    <Style TargetType="{x:Type local:TouchCheckBox}">
        <Setter Property="Background" Value="Transparent"></Setter>
        <Setter Property="Foreground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
        <Setter Property="BorderThickness" Value="1"></Setter>
        <Setter Property="BorderBrush" Value="{StaticResource TangoGrayBrush}"></Setter>
        <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
        <Setter Property="MinHeight" Value="40"></Setter>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:TouchCheckBox}">
                    <Border Padding="{TemplateBinding Padding}" Background="Transparent">
                        <components:Ripple RippleBrush="{StaticResource TangoRippleDarkBrush}" RippleFactor="20" >
                            <DockPanel>
                                <Border Width="30" Height="30" DockPanel.Dock="Left" Padding="5" CornerRadius="2" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
                                    <local:TouchIcon Icon="Check" Visibility="{Binding RelativeSource={RelativeSource AncestorType=local:TouchCheckBox},Path=IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}" Foreground="{TemplateBinding Foreground}"/>
                                </Border>
                                <ContentPresenter TextElement.Foreground="{StaticResource TangoDarkForegroundBrush}" Margin="10 0 0 0" VerticalAlignment="Center" Content="{TemplateBinding Content}"></ContentPresenter>
                            </DockPanel>
                        </components:Ripple>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="BorderBrush" Value="{StaticResource TangoDisabledBackgroundBrush}"></Setter>
                <Setter Property="Foreground" Value="{StaticResource TangoDisabledForegroundBrush}"></Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

</ResourceDictionary>