aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/ToggleIconButton.xaml
diff options
context:
space:
mode:
Diffstat (limited to 'Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/ToggleIconButton.xaml')
-rw-r--r--Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/ToggleIconButton.xaml113
1 files changed, 113 insertions, 0 deletions
diff --git a/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/ToggleIconButton.xaml b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/ToggleIconButton.xaml
new file mode 100644
index 000000000..5eb3ef368
--- /dev/null
+++ b/Software/Visual_Studio/FSE/Tango.FSE.Common/Controls/ToggleIconButton.xaml
@@ -0,0 +1,113 @@
+<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:material="http://materialdesigninxaml.net/winfx/xaml/themes"
+ xmlns:local="clr-namespace:Tango.FSE.Common.Controls">
+
+
+ <Style TargetType="{x:Type local:ToggleIconButton}">
+ <Setter Property="CheckedForeground" Value="{StaticResource FSE_PrimaryForegroundBrush}"></Setter>
+ <Setter Property="UncheckedForeground" Value="{StaticResource FSE_PrimaryForegroundBrush}"></Setter>
+ <Setter Property="FocusVisualStyle" Value="{x:Null}"></Setter>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type local:ToggleIconButton}">
+ <Grid Background="Transparent">
+ <StackPanel Orientation="Horizontal">
+ <TextBlock Margin="0 0 5 0" VerticalAlignment="Center">
+ <TextBlock.Style>
+ <Style TargetType="TextBlock">
+ <Setter Property="Text" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=UncheckedText}"></Setter>
+ <Setter Property="Visibility" Value="Collapsed"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=TextAlignment}" Value="Left">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=IsChecked}" Value="True">
+ <Setter Property="Text" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=CheckedText}"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </TextBlock.Style>
+ </TextBlock>
+ <material:PackIcon IsHitTestVisible="False" RenderTransformOrigin="0.5, 0.5" Width="Auto" Height="Auto">
+ <material:PackIcon.Style>
+ <Style TargetType="material:PackIcon">
+ <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=UncheckedForeground}"></Setter>
+ <Setter Property="Kind" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=UncheckedIcon}"></Setter>
+ <Setter Property="RenderTransform">
+ <Setter.Value>
+ <ScaleTransform ScaleX="1" ScaleY="1" />
+ </Setter.Value>
+ </Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=IsChecked}" Value="True">
+ <Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=CheckedForeground}"></Setter>
+ <Setter Property="Kind" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=CheckedIcon}"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=local:ToggleIconButton},Path=IsMouseOver}" Value="True">
+ <Setter Property="RenderTransform">
+ <Setter.Value>
+ <ScaleTransform ScaleX="1.2" ScaleY="1.2" />
+ </Setter.Value>
+ </Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </material:PackIcon.Style>
+ </material:PackIcon>
+
+ <TextBlock Margin="5 0 0 0" VerticalAlignment="Center">
+ <TextBlock.Style>
+ <Style TargetType="TextBlock">
+ <Setter Property="Text" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=UncheckedText}"></Setter>
+ <Setter Property="Visibility" Value="Collapsed"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=TextAlignment}" Value="Right">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ </DataTrigger>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=IsChecked}" Value="True">
+ <Setter Property="Text" Value="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=CheckedText}"></Setter>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </TextBlock.Style>
+ </TextBlock>
+ </StackPanel>
+ <Canvas IsHitTestVisible="False">
+ <Grid Width="{Binding RelativeSource={RelativeSource AncestorType=Canvas},Path=ActualWidth}" Height="{Binding RelativeSource={RelativeSource AncestorType=Canvas},Path=ActualWidth}">
+ <Ellipse x:Name="ellipse" Fill="White" RenderTransformOrigin="0.5,0.5">
+ <Ellipse.Style>
+ <Style TargetType="Ellipse">
+ <Setter Property="Opacity" Value="0.2"></Setter>
+ <Setter Property="RenderTransform">
+ <Setter.Value>
+ <ScaleTransform ScaleX="0" ScaleY="0" />
+ </Setter.Value>
+ </Setter>
+ <Setter Property="Visibility" Value="Hidden"></Setter>
+ <Style.Triggers>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType=local:ToggleIconButton},Path=IsMouseOver}" Value="True">
+ <Setter Property="Visibility" Value="Visible"></Setter>
+ <DataTrigger.EnterActions>
+ <BeginStoryboard>
+ <Storyboard>
+ <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleX" From="0" To="4" Duration="00:00:0.5" DecelerationRatio="0.8" />
+ <DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY" From="0" To="4" Duration="00:00:0.5" DecelerationRatio="0.8" />
+ <DoubleAnimation Storyboard.TargetProperty="Opacity" From="0.2" To="0.001" Duration="00:00:0.5" DecelerationRatio="0.8" />
+ </Storyboard>
+ </BeginStoryboard>
+ </DataTrigger.EnterActions>
+ </DataTrigger>
+ </Style.Triggers>
+ </Style>
+ </Ellipse.Style>
+ </Ellipse>
+ </Grid>
+ </Canvas>
+ </Grid>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+</ResourceDictionary> \ No newline at end of file