| 1 | <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" |
| 2 | xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" |
| 3 | xmlns:local="clr-namespace:UI.Controls.Navigation" |
| 4 | xmlns:base="clr-namespace:UI.Controls.Base"> |
| 5 | <Style TargetType="{x:Type local:NavigationItem}"> |
| 6 | <Setter Property="SnapsToDevicePixels" |
| 7 | Value="true" /> |
| 8 | <Setter Property="Width" Value="60"/> |
| 9 | |
| 10 | <Setter Property="Height" Value="60"/> |
| 11 | <Setter Property="Background" Value="Transparent"/> |
| 12 | <Setter Property="FocusVisualStyle" Value="{x:Null}"/> |
| 13 | <Setter Property="Template"> |
| 14 | <Setter.Value> |
| 15 | <ControlTemplate TargetType="{x:Type local:NavigationItem}"> |
| 16 | <Border Background="Transparent" CornerRadius="10" x:Name="Border"> |
| 17 | |
| 18 | |
| 19 | |
| 20 | |
| 21 | <VisualStateManager.VisualStateGroups> |
| 22 | <VisualStateGroup x:Name="CommonStates"> |
| 23 | |
| 24 | |
| 25 | |
| 26 | |
| 27 | |
| 28 | <VisualState x:Name="Normal" /> |
| 29 | <VisualState x:Name="MouseOver"> |
| 30 | <Storyboard> |
| 31 | <ColorAnimationUsingKeyFrames |
| 32 | Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" |
| 33 | Storyboard.TargetName="Border" |
| 34 | > |
| 35 | <ColorAnimationUsingKeyFrames.KeyFrames> |
| 36 | <LinearColorKeyFrame Value="{DynamicResource HoverBackgroundColor}" KeyTime="0:0:0" /> |
| 37 | </ColorAnimationUsingKeyFrames.KeyFrames> |
| 38 | </ColorAnimationUsingKeyFrames> |
| 39 | |
| 40 | </Storyboard> |
| 41 | </VisualState> |
| 42 | <VisualState x:Name="Pressed"> |
| 43 | |
| 44 | </VisualState> |
| 45 | </VisualStateGroup> |
| 46 | </VisualStateManager.VisualStateGroups> |
| 47 | |
| 48 | <Grid x:Name="Content" Margin="5"> |
| 49 | |
| 50 | |
| 51 | |
| 52 | |
| 53 | |
| 54 | |
| 55 | |
| 56 | |
| 57 | |
| 58 | <base:Icon x:Name="Icon" IconType="{TemplateBinding Icon}" Foreground="{Binding ElementName=Title,Path=Foreground}" VerticalAlignment="Center" Grid.Column="1" FontSize="17" RenderTransformOrigin="0.5,0.5"> |
| 59 | <base:Icon.RenderTransform> |
| 60 | <TransformGroup> |
| 61 | <TranslateTransform X="0" Y="-5"/> |
| 62 | |
| 63 | |
| 64 | </TransformGroup> |
| 65 | |
| 66 | </base:Icon.RenderTransform> |
| 67 | </base:Icon> |
| 68 | |
| 69 | |
| 70 | |
| 71 | |
| 72 | <TextBlock x:Name="Title" RenderOptions.EdgeMode="Aliased" Text="{TemplateBinding Title}" Grid.Column="2" VerticalAlignment="Bottom" HorizontalAlignment="Center" FontSize="10" Foreground="{DynamicResource NavUnselectedTextBrush}" Margin="0,5,0,0"/> |
| 73 | |
| 74 | |
| 75 | |
| 76 | |
| 77 | </Grid> |
| 78 | |
| 79 | </Border> |
| 80 | <ControlTemplate.Triggers> |
| 81 | <Trigger Property="Title" Value="{x:Null}"> |
| 82 | <Setter Property="Height" Value="15"/> |
| 83 | |
| 84 | |
| 85 | <Setter Property="Visibility" TargetName="Content" Value="Collapsed"/> |
| 86 | </Trigger> |
| 87 | <Trigger Property="IsSelected" Value="True"> |
| 88 | |
| 89 | <Setter TargetName="Title" Property="Foreground" Value="{DynamicResource ThemeBrush}"/> |
| 90 | <Setter TargetName="Title" Property="Visibility" Value="Collapsed"/> |
| 91 | |
| 92 | |
| 93 | </Trigger> |
| 94 | |
| 95 | <MultiTrigger> |
| 96 | <MultiTrigger.Conditions> |
| 97 | <Condition Property="IsSelected" Value="True"/> |
| 98 | </MultiTrigger.Conditions> |
| 99 | <MultiTrigger.EnterActions> |
| 100 | <BeginStoryboard> |
| 101 | <Storyboard> |
| 102 | |
| 103 | |
| 104 | <DoubleAnimation Duration="0:0:0.5" |
| 105 | Storyboard.TargetProperty="(base:Icon.RenderTransform).Children[0].(TranslateTransform.Y)" Storyboard.TargetName="Icon" To="0" > |
| 106 | <DoubleAnimation.EasingFunction> |
| 107 | <BackEase EasingMode="EaseIn"/> |
| 108 | </DoubleAnimation.EasingFunction> |
| 109 | </DoubleAnimation> |
| 110 | |
| 111 | </Storyboard> |
| 112 | </BeginStoryboard> |
| 113 | </MultiTrigger.EnterActions> |
| 114 | <MultiTrigger.ExitActions> |
| 115 | <BeginStoryboard> |
| 116 | <Storyboard> |
| 117 | |
| 118 | |
| 119 | <DoubleAnimation Duration="0:0:0.25" |
| 120 | Storyboard.TargetProperty="(base:Icon.RenderTransform).Children[0].(TranslateTransform.Y)" Storyboard.TargetName="Icon" To="-5" > |
| 121 | <DoubleAnimation.EasingFunction> |
| 122 | <BackEase EasingMode="EaseOut"/> |
| 123 | </DoubleAnimation.EasingFunction> |
| 124 | </DoubleAnimation> |
| 125 | |
| 126 | </Storyboard> |
| 127 | </BeginStoryboard> |
| 128 | </MultiTrigger.ExitActions> |
| 129 | </MultiTrigger> |
| 130 | <Trigger Property="IsSelected" Value="True"> |
| 131 | <Setter TargetName="Border" Property="Background" Value="{DynamicResource NavSelectedBrush}"/> |
| 132 | <Setter TargetName="Icon" Property="IconType" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type local:NavigationItem}}, Path=SelectedIcon}"/> |
| 133 | </Trigger> |
| 134 | |
| 135 | </ControlTemplate.Triggers> |
| 136 | </ControlTemplate> |
| 137 | </Setter.Value> |
| 138 | </Setter> |
| 139 | </Style> |
| 140 | </ResourceDictionary> |