Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
50
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.62 KB | None | 0 0
  1. <Style x:Key="MyCustomStyle" TargetType="ComboBox">
  2. <Setter Property="Template">
  3. <Setter.Value>
  4. <ControlTemplate TargetType="ComboBox">
  5. <Grid>
  6. <VisualStateManager.VisualStateGroups>
  7. <VisualStateGroup x:Name="CommonStates">
  8. <VisualState x:Name="Disabled">
  9. <Storyboard>
  10. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Background" Storyboard.TargetName="Background">
  11. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxDisabledBackgroundThemeBrush}"/>
  12. </ObjectAnimationUsingKeyFrames>
  13. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="BorderBrush" Storyboard.TargetName="Background">
  14. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxDisabledBorderThemeBrush}"/>
  15. </ObjectAnimationUsingKeyFrames>
  16. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="ContentPresenter">
  17. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxDisabledForegroundThemeBrush}"/>
  18. </ObjectAnimationUsingKeyFrames>
  19. <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground" Storyboard.TargetName="DropDownGlyph">
  20. <DiscreteObjectKeyFrame KeyTime="0" Value="{ThemeResource ComboBoxArrowDisabledForegroundThemeBrush}"/>
  21. </ObjectAnimationUsingKeyFrames>
  22. </Storyboard>
  23. </VisualState>
  24. </VisualStateGroup>
  25. </VisualStateManager.VisualStateGroups>
  26. ...
  27. <ContentPresenter x:Name="ContentPresenter" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Grid.Row="1" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
  28. <TextBlock x:Name="PlaceholderTextBlock" Foreground="#FFAAAAAA" FontWeight="Normal" Text="{TemplateBinding PlaceholderText}"/>
  29. </ContentPresenter>
  30.  
  31. .....
  32. <ContentPresenter x:Name="ContentPresenter"
  33. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  34. Margin="{TemplateBinding Padding}"
  35. Grid.Row="1"
  36. VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
  37. <TextBlock x:Name="PlaceholderTextBlock"
  38. Foreground="{ThemeResource ComboBoxPlaceholderTextForegroundThemeBrush}"
  39. FontWeight="{ThemeResource ComboBoxPlaceholderTextThemeFontWeight}"
  40. Text="{TemplateBinding PlaceholderText}" />
  41. </ContentPresenter>
  42. ....
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement