ListBox.xaml 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  2. <Style x:Key="DefaultListBoxItem" TargetType="{x:Type ListBoxItem}">
  3. <Setter Property="Height" Value="90" />
  4. <Setter Property="Margin" Value="5" />
  5. <Setter Property="Cursor" Value="Hand" />
  6. <Setter Property="Foreground" Value="{DynamicResource DefaultForeground}" />
  7. <Setter Property="Background" Value="{DynamicResource BorderBackground}" />
  8. <Setter Property="BorderThickness" Value="0" />
  9. <Style.Triggers>
  10. <Trigger Property="IsSelected" Value="True">
  11. <Setter Property="Background" Value="{DynamicResource BorderActiveBackground}" />
  12. </Trigger>
  13. <Trigger Property="IsMouseOver" Value="True">
  14. <Setter Property="Background" Value="{DynamicResource BorderActiveBackground}" />
  15. </Trigger>
  16. </Style.Triggers>
  17. </Style>
  18. <Style x:Key="DefaultNoBorderListBoxItem" TargetType="{x:Type ListBoxItem}">
  19. <Setter Property="Margin" Value="5" />
  20. <Setter Property="Cursor" Value="Hand" />
  21. <Setter Property="Foreground" Value="{DynamicResource DefaultForeground}" />
  22. <Setter Property="BorderThickness" Value="0" />
  23. <Style.Triggers>
  24. <Trigger Property="IsSelected" Value="True">
  25. <Setter Property="Background" Value="{DynamicResource BorderActiveBackground}" />
  26. </Trigger>
  27. <Trigger Property="IsMouseOver" Value="True">
  28. <Setter Property="Background" Value="{DynamicResource BorderActiveBackground}" />
  29. </Trigger>
  30. </Style.Triggers>
  31. </Style>
  32. <Style TargetType="ListBox">
  33. <Setter Property="BorderBrush" Value="#dddddd" />
  34. <Setter Property="Background" Value="Transparent" />
  35. <Setter Property="Template">
  36. <Setter.Value>
  37. <ControlTemplate TargetType="ListBox">
  38. <Border
  39. Background="{TemplateBinding Background}"
  40. BorderBrush="{TemplateBinding BorderBrush}"
  41. BorderThickness="{TemplateBinding BorderThickness}">
  42. <ScrollViewer
  43. Padding="0"
  44. CanContentScroll="False"
  45. HorizontalScrollBarVisibility="Disabled"
  46. VerticalScrollBarVisibility="Auto">
  47. <ItemsPresenter ClipToBounds="True" />
  48. </ScrollViewer>
  49. </Border>
  50. </ControlTemplate>
  51. </Setter.Value>
  52. </Setter>
  53. </Style>
  54. </ResourceDictionary>