| 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.Button" |
| 4 | xmlns:base="clr-namespace:UI.Controls.Base" |
| 5 | xmlns:sys="clr-namespace:System;assembly=mscorlib"> |
| 6 | <Style TargetType="{x:Type local:IconButton}"> |
| 7 | <Setter Property="SnapsToDevicePixels" |
| 8 | Value="true" /> |
| 9 | <Setter Property="Width" Value="35"/> |
| 10 | <Setter Property="Height" Value="35"/> |
| 11 | <Setter Property="FontSize" Value="16"/> |
| 12 | |
| 13 | <Setter Property="Background" Value="Transparent"/> |
| 14 | <Setter Property="Template"> |
| 15 | <Setter.Value> |
| 16 | <ControlTemplate TargetType="{x:Type local:IconButton}"> |
| 17 | |
| 18 | |
| 19 | <Border Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" x:Name="BoxBorder" CornerRadius="4" Padding="5" Background="Transparent"> |
| 20 | <Grid> |
| 21 | |
| 22 | <base:Icon x:Name="Icon" IconType="{TemplateBinding Icon}" Foreground="{DynamicResource StandardTextBrush}" VerticalAlignment="Center" FontSize="{TemplateBinding FontSize}" > |
| 23 | |
| 24 | </base:Icon> |
| 25 | <ContentPresenter /> |
| 26 | </Grid> |
| 27 | |
| 28 | <VisualStateManager.VisualStateGroups> |
| 29 | <VisualStateGroup x:Name="CommonStates"> |
| 30 | <VisualStateGroup.Transitions> |
| 31 | <VisualTransition GeneratedDuration="0:0:0" /> |
| 32 | <VisualTransition GeneratedDuration="0" |
| 33 | To="Pressed" /> |
| 34 | </VisualStateGroup.Transitions> |
| 35 | <VisualState x:Name="Normal" /> |
| 36 | <VisualState x:Name="MouseOver"> |
| 37 | <Storyboard> |
| 38 | <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" |
| 39 | Storyboard.TargetName="BoxBorder"> |
| 40 | <EasingColorKeyFrame KeyTime="0" |
| 41 | Value="{DynamicResource HoverBackgroundColor}" /> |
| 42 | </ColorAnimationUsingKeyFrames> |
| 43 | </Storyboard> |
| 44 | </VisualState> |
| 45 | <VisualState x:Name="Pressed"> |
| 46 | <Storyboard> |
| 47 | <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" |
| 48 | Storyboard.TargetName="BoxBorder"> |
| 49 | <EasingColorKeyFrame KeyTime="0" |
| 50 | Value="{DynamicResource ThemeColor}" /> |
| 51 | </ColorAnimationUsingKeyFrames> |
| 52 | <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(base:Icon.Foreground).(SolidColorBrush.Color)" |
| 53 | Storyboard.TargetName="Icon"> |
| 54 | <EasingColorKeyFrame KeyTime="0" |
| 55 | Value="#fff" /> |
| 56 | </ColorAnimationUsingKeyFrames> |
| 57 | </Storyboard> |
| 58 | </VisualState> |
| 59 | </VisualStateGroup> |
| 60 | </VisualStateManager.VisualStateGroups> |
| 61 | </Border> |
| 62 | |
| 63 | |
| 64 | |
| 65 | |
| 66 | <ControlTemplate.Triggers> |
| 67 | |
| 68 | </ControlTemplate.Triggers> |
| 69 | </ControlTemplate> |
| 70 | </Setter.Value> |
| 71 | </Setter> |
| 72 | </Style> |
| 73 | </ResourceDictionary> |