You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
104 lines
6.1 KiB
104 lines
6.1 KiB
<UserControl x:Class="W10SS_GUI.Controls.HamburgerCategoryFlashButton"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:local="clr-namespace:W10SS_GUI.Controls"
|
|
mc:Ignorable="d"
|
|
d:DesignHeight="{StaticResource buttonHamburgerHeight}" d:DesignWidth="{StaticResource panelHamburgerMaxWidth}">
|
|
<UserControl.Resources>
|
|
<Style TargetType="TextBlock">
|
|
<Style.Triggers>
|
|
<Trigger Property="IsEnabled" Value="True">
|
|
<Setter Property="Foreground" Value="{DynamicResource colorTextHamburgerForeground}" />
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter Property="Foreground" Value="{DynamicResource colorTextHamburgerForegroundDisabled}"/>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
<Style TargetType="Path">
|
|
<Style.Triggers>
|
|
<Trigger Property="IsEnabled" Value="True">
|
|
<Setter Property="Fill" Value="{DynamicResource colorTextHamburgerForeground}" />
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Setter Property="Fill" Value="{DynamicResource colorTextHamburgerForegroundDisabled}"/>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</UserControl.Resources>
|
|
<Grid Tag="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=Tag}">
|
|
<StackPanel Name="hamburgerButton"
|
|
Width="{DynamicResource panelHamburgerMaxWidth}"
|
|
Height="{DynamicResource buttonHamburgerHeight}"
|
|
Orientation="Horizontal">
|
|
<StackPanel.Background>
|
|
<SolidColorBrush Color="{DynamicResource buttonHamburgerBackgroundColor }" x:Name="buttonHamburgerBackgroundColor"/>
|
|
</StackPanel.Background>
|
|
<StackPanel.Style>
|
|
<Style TargetType="StackPanel">
|
|
<Style.Triggers>
|
|
<Trigger Property="IsEnabled" Value="True">
|
|
<Trigger.EnterActions>
|
|
<BeginStoryboard Name="animationHamburgerIsEnabled" Storyboard="{DynamicResource animationHamburgerApplyButtonIsEnabled}"/>
|
|
</Trigger.EnterActions>
|
|
</Trigger>
|
|
<Trigger Property="IsEnabled" Value="False">
|
|
<Trigger.EnterActions>
|
|
<PauseStoryboard BeginStoryboardName="animationHamburgerIsEnabled" />
|
|
<BeginStoryboard Name="animationHamburgerIsDisabled" Storyboard="{DynamicResource animationHamburgerApplyButtonIsDisabled}"/>
|
|
</Trigger.EnterActions>
|
|
</Trigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</StackPanel.Style>
|
|
<StackPanel.Triggers>
|
|
<EventTrigger RoutedEvent="MouseEnter">
|
|
<BeginStoryboard Storyboard="{DynamicResource animationHamburgerApplyHover}" />
|
|
</EventTrigger>
|
|
<EventTrigger RoutedEvent="MouseLeave">
|
|
<BeginStoryboard Storyboard="{DynamicResource animationHamburgerApplyButtonIsEnabled}"/>
|
|
</EventTrigger>
|
|
<EventTrigger RoutedEvent="MouseLeftButtonDown">
|
|
<BeginStoryboard >
|
|
<Storyboard>
|
|
<ThicknessAnimation Storyboard.TargetName="hamburgerContainer"
|
|
Storyboard.TargetProperty="Margin"
|
|
Duration="0:0:0.5"
|
|
From="0 0 0 0"
|
|
To="0 5 0 0"
|
|
SpeedRatio="5"
|
|
AutoReverse="True"/>
|
|
</Storyboard>
|
|
</BeginStoryboard>
|
|
</EventTrigger>
|
|
</StackPanel.Triggers>
|
|
|
|
<StackPanel Name="hamburgerContainer" Orientation="Horizontal">
|
|
|
|
<TextBlock Name="textIcon"
|
|
FontFamily="{StaticResource fontHamburgerCategoryFlashButtonIcon}"
|
|
FontSize="{DynamicResource buttonHamburgerIconsSize}"
|
|
Margin="10 0 10 0"
|
|
VerticalAlignment="Center"
|
|
Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=Icon}"
|
|
Visibility="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=IconVisibility}"/>
|
|
|
|
<Viewbox Width="24"
|
|
Height="24"
|
|
Margin="7 0 10 0"
|
|
Visibility="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=ViewboxPathVisibility}">
|
|
<Canvas Width="24" Height="24">
|
|
<Path Data="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=ViewboxPathData}" />
|
|
</Canvas>
|
|
</Viewbox>
|
|
|
|
<TextBlock Name="textCategory" FontSize="{DynamicResource textHamburgerSize}"
|
|
Margin="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=TextMargin}"
|
|
VerticalAlignment="Center"
|
|
Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=Text}"/>
|
|
</StackPanel>
|
|
</StackPanel>
|
|
</Grid>
|
|
</UserControl>
|
|
|