Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <Style x:Key="{x:Type ComboBoxItem}" TargetType="{x:Type ComboBoxItem}">
- <Setter Property="SnapsToDevicePixels" Value="true" />
- <Setter Property="OverridesDefaultStyle" Value="true" />
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate TargetType="{x:Type ComboBoxItem}">
- <Border x:Name="Border"
- Padding="2"
- SnapsToDevicePixels="true">
- <Border.Style>
- <Style TargetType="{x:Type Border}">
- <Style.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Trigger.EnterActions>
- <BeginStoryboard>
- <Storyboard>
- <ColorAnimation Duration="0:0:0.01"
- Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
- To="#FFA7ACD4" />
- </Storyboard>
- </BeginStoryboard>
- </Trigger.EnterActions>
- <Trigger.ExitActions>
- <BeginStoryboard>
- <Storyboard>
- <ColorAnimation Duration="0:0:0.6"
- Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
- To="White" />
- </Storyboard>
- </BeginStoryboard>
- </Trigger.ExitActions>
- </Trigger>
- </Style.Triggers>
- </Style>
- </Border.Style>
- <VisualStateManager.VisualStateGroups>
- <VisualStateGroup x:Name="SelectionStates">
- <VisualState x:Name="Unselected" />
- <VisualState x:Name="Selected">
- <Storyboard>
- <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
- Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
- <EasingColorKeyFrame KeyTime="0" Value="{DynamicResource ColorItemSelectedBackground}" />
- </ColorAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- <VisualState x:Name="SelectedUnfocused">
- <Storyboard>
- <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
- Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
- <EasingColorKeyFrame KeyTime="0"
- Value="{StaticResource SelectedUnfocusedColor}" />
- </ColorAnimationUsingKeyFrames>
- </Storyboard>
- </VisualState>
- </VisualStateGroup>
- </VisualStateManager.VisualStateGroups>
- <ContentPresenter />
- </Border>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement