aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch/Controls/TouchButton.xaml
blob: 5b186162359afc18555a72b9c813affa238f9690 (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
<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:shadows="clr-namespace:Microsoft.Windows.Themes;assembly=PresentationFramework.Aero"
                    xmlns:local="clr-namespace:Tango.Touch.Controls">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="../Resources/Colors.xaml" />
        <ResourceDictionary Source="../Resources/Fonts.xaml" />
        <ResourceDictionary Source="../Controls/Shared.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style TargetType="{x:Type local:TouchButton}">
        <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
        <Setter Property="components:TransformationHelper.TransformWhenPressed" Value="True"></Setter>
        <Setter Property="Background" Value="{StaticResource TangoPrimaryAccentBrush}"/>
        <Setter Property="Foreground" Value="{StaticResource TangoLightForegroundBrush}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="FontWeight" Value="Medium"></Setter>
        <Setter Property="Stylus.IsPressAndHoldEnabled" Value="False"></Setter>
        <Setter Property="HorizontalContentAlignment" Value="Center"/>
        <Setter Property="VerticalContentAlignment" Value="Center"/>
        <Setter Property="RippleBrush" Value="{StaticResource TangoRippleLightBrush}"></Setter>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type local:TouchButton}">
                    <Border x:Name="border" Style="{StaticResource DropShadowBorder}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{TemplateBinding CornerRadius}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
                        <components:Ripple Centered="{TemplateBinding RippleCentered}" RippleBrush="{TemplateBinding RippleBrush}" RippleFactor="{TemplateBinding RippleFactor}" CornerRadius="{TemplateBinding CornerRadius}">
                            <ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
                        </components:Ripple>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Background" Value="{StaticResource TangoDisabledBackgroundBrush}"></Setter>
                <Setter Property="BorderBrush" Value="{StaticResource TangoDisabledBackgroundBrush}"></Setter>
                <Setter Property="Foreground" Value="{StaticResource TangoDisabledForegroundBrush}"></Setter>
            </Trigger>
        </Style.Triggers>
    </Style>

</ResourceDictionary>