ListBoxStyle.xaml 2.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  2. <!-- 用于页面编辑的Item样式 -->
  3. <ControlTemplate x:Key="ListBoxItemControlTemplate" TargetType="{x:Type ListBoxItem}">
  4. <Border
  5. x:Name="Bd"
  6. Padding="{TemplateBinding Padding}"
  7. Background="{TemplateBinding Background}"
  8. BorderBrush="{TemplateBinding BorderBrush}"
  9. BorderThickness="{TemplateBinding BorderThickness}"
  10. SnapsToDevicePixels="True">
  11. <ContentPresenter
  12. Content="{TemplateBinding Content}"
  13. ContentStringFormat="{TemplateBinding ContentStringFormat}"
  14. ContentTemplate="{TemplateBinding ContentTemplate}"
  15. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  16. </Border>
  17. <ControlTemplate.Triggers>
  18. <!--<MultiTrigger>
  19. <MultiTrigger.Conditions>
  20. <Condition Property="IsMouseOver" Value="True" />
  21. </MultiTrigger.Conditions>
  22. <Setter TargetName="Bd" Property="Background" Value="#1A000000" />
  23. <Setter TargetName="Bd" Property="BorderBrush" Value="Transparent" />
  24. </MultiTrigger>
  25. <MultiTrigger>
  26. <MultiTrigger.Conditions>
  27. <Condition Property="Selector.IsSelectionActive" Value="False" />
  28. <Condition Property="IsSelected" Value="True" />
  29. </MultiTrigger.Conditions>
  30. --><!--<Setter TargetName="Bd" Property="Background" Value="#1A477EDE" />
  31. <Setter TargetName="Bd" Property="BorderBrush" Value="Transparent" />--><!--
  32. </MultiTrigger>
  33. <MultiTrigger>
  34. <MultiTrigger.Conditions>
  35. <Condition Property="Selector.IsSelectionActive" Value="True" />
  36. <Condition Property="IsSelected" Value="True" />
  37. </MultiTrigger.Conditions>
  38. --><!--<Setter TargetName="Bd" Property="Background" Value="#1A477EDE" />
  39. <Setter TargetName="Bd" Property="BorderBrush" Value="Transparent" />--><!--
  40. </MultiTrigger>
  41. <Trigger Property="IsEnabled" Value="False">
  42. <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  43. </Trigger>-->
  44. </ControlTemplate.Triggers>
  45. </ControlTemplate>
  46. </ResourceDictionary>