aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch/Controls/TouchIconButton.xaml
blob: 5875b26d0222c2b6a7f9885361a24bb3dbe0bf46 (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
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:fa="http://schemas.fontawesome.io/icons/"
                    xmlns:local="clr-namespace:Tango.Touch.Controls">

    <ResourceDictionary.MergedDictionaries>
        <ResourceDictionary Source="../Controls/TouchButton.xaml" />
    </ResourceDictionary.MergedDictionaries>

    <Style TargetType="{x:Type local:TouchIconButton}" BasedOn="{StaticResource {x:Type local:TouchButton}}">
        <Setter Property="Icon" Value="None"></Setter>
        <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}"></Setter>
        <Setter Property="Background" Value="Transparent"></Setter>
        <Setter Property="EnableDropShadow" Value="False"></Setter>
        <Setter Property="ContentTemplate">
            <Setter.Value>
                <DataTemplate>
                    <local:TouchIcon RenderTransformOrigin="0.5,0.5" Foreground="{Binding RelativeSource={RelativeSource AncestorType=local:TouchIconButton},Path=Foreground}" Icon="{Binding RelativeSource={RelativeSource AncestorType=local:TouchIconButton},Path=Icon}">
                        <local:TouchIcon.RenderTransform>
                            <RotateTransform Angle="{Binding RelativeSource={RelativeSource AncestorType=local:TouchIconButton},Path=IconAngle}" />
                        </local:TouchIcon.RenderTransform>
                    </local:TouchIcon>
                </DataTemplate>
            </Setter.Value>
        </Setter>
        <Style.Triggers>
            <Trigger Property="IsEnabled" Value="False">
                <Setter Property="Background" Value="Transparent"></Setter>
                <Setter Property="BorderBrush" Value="Transparent"></Setter>
                <Setter Property="Foreground" Value="{StaticResource TangoDisabledForegroundBrush}"></Setter>
            </Trigger>
        </Style.Triggers>
    </Style>


</ResourceDictionary>