Advertisement
Guest User

Untitled

a guest
Feb 19th, 2017
56
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.73 KB | None | 0 0
  1. <Style x:Key="{x:Type ComboBoxItem}" TargetType="{x:Type ComboBoxItem}">
  2. <Setter Property="SnapsToDevicePixels" Value="true" />
  3. <Setter Property="OverridesDefaultStyle" Value="true" />
  4. <Setter Property="Template">
  5. <Setter.Value>
  6. <ControlTemplate TargetType="{x:Type ComboBoxItem}">
  7. <Border x:Name="Border"
  8. Padding="2"
  9. SnapsToDevicePixels="true">
  10. <Border.Style>
  11. <Style TargetType="{x:Type Border}">
  12. <Style.Triggers>
  13. <Trigger Property="IsMouseOver" Value="True">
  14. <Trigger.EnterActions>
  15. <BeginStoryboard>
  16. <Storyboard>
  17. <ColorAnimation Duration="0:0:0.01"
  18. Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
  19. To="#FFA7ACD4" />
  20. </Storyboard>
  21. </BeginStoryboard>
  22. </Trigger.EnterActions>
  23. <Trigger.ExitActions>
  24. <BeginStoryboard>
  25. <Storyboard>
  26. <ColorAnimation Duration="0:0:0.6"
  27. Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)"
  28. To="White" />
  29. </Storyboard>
  30. </BeginStoryboard>
  31. </Trigger.ExitActions>
  32. </Trigger>
  33. </Style.Triggers>
  34. </Style>
  35. </Border.Style>
  36. <VisualStateManager.VisualStateGroups>
  37. <VisualStateGroup x:Name="SelectionStates">
  38. <VisualState x:Name="Unselected" />
  39. <VisualState x:Name="Selected">
  40. <Storyboard>
  41. <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
  42. Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
  43. <EasingColorKeyFrame KeyTime="0" Value="{DynamicResource ColorItemSelectedBackground}" />
  44. </ColorAnimationUsingKeyFrames>
  45. </Storyboard>
  46. </VisualState>
  47. <VisualState x:Name="SelectedUnfocused">
  48. <Storyboard>
  49. <ColorAnimationUsingKeyFrames Storyboard.TargetName="Border"
  50. Storyboard.TargetProperty="(Panel.Background).(SolidColorBrush.Color)">
  51. <EasingColorKeyFrame KeyTime="0"
  52. Value="{StaticResource SelectedUnfocusedColor}" />
  53. </ColorAnimationUsingKeyFrames>
  54. </Storyboard>
  55. </VisualState>
  56. </VisualStateGroup>
  57. </VisualStateManager.VisualStateGroups>
  58. <ContentPresenter />
  59. </Border>
  60. </ControlTemplate>
  61. </Setter.Value>
  62. </Setter>
  63. </Style>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement