| 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.List" |
| 4 | xmlns:base="clr-namespace:UI.Controls.Base" |
| 5 | xmlns:sys="clr-namespace:System;assembly=mscorlib"> |
| 6 | <Style TargetType="{x:Type local:BaseListItem}"> |
| 7 | <Setter Property="SnapsToDevicePixels" |
| 8 | Value="true" /> |
| 9 | <Setter Property="UseLayoutRounding" Value="True"/> |
| 10 | |
| 11 | |
| 12 | <Setter Property="Height" Value="35"/> |
| 13 | <Setter Property="Margin" Value="0,10,0,0"/> |
| 14 | |
| 15 | <Setter Property="Background" Value="Transparent"/> |
| 16 | <Setter Property="Template"> |
| 17 | <Setter.Value> |
| 18 | <ControlTemplate TargetType="{x:Type local:BaseListItem}"> |
| 19 | <Grid Background="{TemplateBinding Background}" SnapsToDevicePixels="True"> |
| 20 | |
| 21 | <Border BorderBrush="#f3f3f3" BorderThickness="0" Width="{TemplateBinding Width}" Height="{TemplateBinding Height}" x:Name="BoxBorder" CornerRadius="4" Background="{DynamicResource BaseListItemBgBrush}" > |
| 22 | <Grid VerticalAlignment="Center" Margin="10,0"> |
| 23 | <Grid.ColumnDefinitions> |
| 24 | <ColumnDefinition Width="9*"/> |
| 25 | <ColumnDefinition Width="1*"/> |
| 26 | </Grid.ColumnDefinitions> |
| 27 | <TextBlock Text="{TemplateBinding Text}"/> |
| 28 | </Grid> |
| 29 | |
| 30 | </Border> |
| 31 | <Border x:Name="Shadow" BorderBrush="{Binding ElementName=BoxBorder,Path=BorderBrush}" BorderThickness="{Binding ElementName=BoxBorder,Path=BorderThickness}" Panel.ZIndex="-1" Width="{Binding ElementName=BoxBorder,Path=ActualWidth}" Height="{Binding ElementName=BoxBorder,Path=ActualHeight}" CornerRadius="{Binding ElementName=BoxBorder,Path=CornerRadius}" Background="{Binding ElementName=BoxBorder,Path=Background}"> |
| 32 | <Border.Effect> |
| 33 | <DropShadowEffect BlurRadius="5" ShadowDepth="2" Direction="315" Color="#ccc" Opacity=".05"/> |
| 34 | </Border.Effect> |
| 35 | </Border> |
| 36 | |
| 37 | <VisualStateManager.VisualStateGroups> |
| 38 | <VisualStateGroup x:Name="CommonStates"> |
| 39 | <VisualStateGroup.Transitions> |
| 40 | <VisualTransition GeneratedDuration="0:0:0.18" /> |
| 41 | <VisualTransition GeneratedDuration="0" |
| 42 | To="Pressed" /> |
| 43 | </VisualStateGroup.Transitions> |
| 44 | <VisualState x:Name="Normal" /> |
| 45 | <VisualState x:Name="MouseOver"> |
| 46 | <Storyboard> |
| 47 | <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Effect).(DropShadowEffect.Color)" |
| 48 | Storyboard.TargetName="Shadow"> |
| 49 | <EasingColorKeyFrame KeyTime="0" |
| 50 | Value="{DynamicResource ThemeColor}"/> |
| 51 | </ColorAnimationUsingKeyFrames> |
| 52 | <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="(Border.Background).(SolidColorBrush.Color)" |
| 53 | Storyboard.TargetName="BoxBorder"> |
| 54 | <EasingColorKeyFrame KeyTime="0" |
| 55 | Value="{DynamicResource BaseListItemHoverBgColor}" /> |
| 56 | </ColorAnimationUsingKeyFrames> |
| 57 | |
| 58 | |
| 59 | |
| 60 | |
| 61 | |
| 62 | </Storyboard> |
| 63 | </VisualState> |
| 64 | <VisualState x:Name="Pressed"> |
| 65 | |
| 66 | </VisualState> |
| 67 | </VisualStateGroup> |
| 68 | </VisualStateManager.VisualStateGroups> |
| 69 | |
| 70 | </Grid> |
| 71 | <ControlTemplate.Triggers> |
| 72 | <Trigger Property="IsSelected" Value="True"> |
| 73 | <Setter TargetName="BoxBorder" Property="Background" Value="{DynamicResource ThemeBrush}"/> |
| 74 | <Setter Property="Foreground" Value="White"/> |
| 75 | |
| 76 | </Trigger> |
| 77 | |
| 78 | |
| 79 | |
| 80 | </ControlTemplate.Triggers> |
| 81 | </ControlTemplate> |
| 82 | </Setter.Value> |
| 83 | </Setter> |
| 84 | </Style> |
| 85 | </ResourceDictionary> |