aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch/Controls/TouchButton.xaml
blob: 34716f7402be1d4d088ed4c7863970e27a4ced66 (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
47
48
49
<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.Triggers>
                        <!--<Trigger Property="IsPressed" Value="true">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource Button.Pressed.Background}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource Button.Pressed.Border}"/>
                        </Trigger>-->
                        <Trigger Property="IsEnabled" Value="false">
                            <Setter Property="Background" TargetName="border" Value="{StaticResource TangoDisabledBackgroundBrush}"/>
                            <Setter Property="BorderBrush" TargetName="border" Value="{StaticResource TangoDisabledBackgroundBrush}"/>
                            <Setter Property="TextElement.Foreground" TargetName="contentPresenter" Value="{StaticResource TangoDisabledForegroundBrush}"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

</ResourceDictionary>