Script to setup Windows 10 1903
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.
 

94 lines
5.5 KiB

<UserControl x:Class="W10SS_GUI.Controls.HamburgerCategoryButton"
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>
<StackPanel Name="hamburgerButton"
Width="{DynamicResource panelHamburgerMaxWidth}"
Height="{DynamicResource buttonHamburgerHeight}"
Orientation="Horizontal"
Tag="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=Tag}">
<StackPanel.Background>
<SolidColorBrush Color="{DynamicResource buttonHamburgerBackgroundColor }" x:Name="buttonHamburgerBackgroundColor"/>
</StackPanel.Background>
<StackPanel.Triggers>
<EventTrigger RoutedEvent="MouseEnter">
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetName="buttonHamburgerBackgroundColor" Storyboard.TargetProperty="Color"
Duration="0:0:0.1" To="{DynamicResource buttonHamburgerHoverColor}" />
</Storyboard>
</BeginStoryboard>
</EventTrigger>
<EventTrigger RoutedEvent="MouseLeave">
<BeginStoryboard>
<Storyboard>
<ColorAnimation Storyboard.TargetName="buttonHamburgerBackgroundColor" Storyboard.TargetProperty="Color"
Duration="0:0:0.5" To="{DynamicResource buttonHamburgerBackgroundColor}" />
</Storyboard>
</BeginStoryboard>
</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 fontHamburgerCategoryButtonIcon}"
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>