aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/Tango.Touch/Controls/TouchToggleImageButton.xaml
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/Tango.Touch/Controls/TouchToggleImageButton.xaml')
-rw-r--r--Software/Visual_Studio/Tango.Touch/Controls/TouchToggleImageButton.xaml36
1 files changed, 36 insertions, 0 deletions
diff --git a/Software/Visual_Studio/Tango.Touch/Controls/TouchToggleImageButton.xaml b/Software/Visual_Studio/Tango.Touch/Controls/TouchToggleImageButton.xaml
new file mode 100644
index 000000000..772dea7c3
--- /dev/null
+++ b/Software/Visual_Studio/Tango.Touch/Controls/TouchToggleImageButton.xaml
@@ -0,0 +1,36 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:converters="clr-namespace:Tango.SharedUI.Converters;assembly=Tango.SharedUI"
+ xmlns:components="clr-namespace:Tango.Touch.Components"
+ xmlns:local="clr-namespace:Tango.Touch.Controls">
+
+ <ResourceDictionary.MergedDictionaries>
+ <ResourceDictionary Source="../Resources/Colors.xaml" />
+ </ResourceDictionary.MergedDictionaries>
+
+ <converters:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConverter" />
+ <converters:BooleanToVisibilityInverseConverter x:Key="BooleanToVisibilityInverseConverter" />
+
+ <Style TargetType="{x:Type local:TouchToggleImageButton}">
+ <Setter Property="Foreground" Value="{StaticResource TangoDarkForegroundBrush}"></Setter>
+ <Setter Property="CheckedForeground" Value="{StaticResource TangoPrimaryAccentBrush}"></Setter>
+ <Setter Property="Background" Value="Transparent"></Setter>
+ <Setter Property="Width" Value="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}"></Setter>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type local:TouchToggleImageButton}">
+ <Border Background="{TemplateBinding Background}"
+ BorderBrush="{TemplateBinding BorderBrush}"
+ BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="{TemplateBinding CornerRadius}">
+ <components:Ripple CornerRadius="{TemplateBinding CornerRadius}" RippleBrush="{StaticResource TangoRippleDarkBrush}">
+ <Grid Margin="{TemplateBinding Padding}">
+ <Image Source="{Binding RelativeSource={RelativeSource AncestorType=local:TouchToggleImageButton},Path=UncheckedImage}" Visibility="{TemplateBinding IsChecked,Converter={StaticResource BooleanToVisibilityInverseConverter}}"></Image>
+ <Image Source="{Binding RelativeSource={RelativeSource AncestorType=local:TouchToggleImageButton},Path=CheckedImage}" Visibility="{TemplateBinding IsChecked,Converter={StaticResource BooleanToVisibilityConverter}}"></Image>
+ </Grid>
+ </components:Ripple>
+ </Border>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+</ResourceDictionary> \ No newline at end of file