1
0
mirror of https://github.com/DarthAffe/Arge.git synced 2022-11-28 19:26:16 +00:00
Arge/Arge/Styles/Navigation.xaml

108 lines
5.2 KiB
XML

<resources:CachedResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:resources="clr-namespace:Arge.Resources">
<resources:CachedResourceDictionary.MergedDictionaries>
<resources:CachedResourceDictionary Source="/Arge;component/Styles/FrameworkElement.xaml" />
</resources:CachedResourceDictionary.MergedDictionaries>
<Style x:Key="StyleNavigationListBoxItemContainer"
TargetType="{x:Type ListBoxItem}">
<Setter Property="FontSize" Value="{DynamicResource FontSizeNavigation}" />
<Setter Property="FontFamily" Value="{Binding Source={x:Static resources:Fonts.Instance}, Path=Navigation}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border Margin="8,0"
Padding="4"
IsHitTestVisible="True"
BorderThickness="0"
Background="Transparent">
<Grid>
<TextBlock x:Name="TxtBlurred"
VerticalAlignment="Center"
HorizontalAlignment="Center"
FontWeight="Black"
Opacity="0"
Foreground="{DynamicResource BrushNavigationItemBlur}"
Text="{Binding UrlPathSegment}">
<TextBlock.Effect>
<BlurEffect Radius="{DynamicResource DoubleNavigationBlurRadius}" />
</TextBlock.Effect>
</TextBlock>
<TextBlock VerticalAlignment="Center"
HorizontalAlignment="Center"
Foreground="{DynamicResource BrushNavigationItem}"
Text="{Binding UrlPathSegment}" />
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard TargetName="TxtBlurred">
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.5" Duration="0:0:0.150" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard TargetName="TxtBlurred">
<DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="0:0:0.250" />
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard TargetName="TxtBlurred">
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="1.0" Duration="0:0:0.150" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard TargetName="TxtBlurred">
<DoubleAnimation Storyboard.TargetProperty="Opacity" Duration="0:0:0.250" />
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="StyleNavigationListBox"
TargetType="ListBox">
<Setter Property="Background" Value="{x:Null}" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="ItemContainerStyle" Value="{StaticResource StyleNavigationListBoxItemContainer}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBox}">
<ItemsPresenter />
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<StackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
</Style>
</resources:CachedResourceDictionary>