CustomListItemStyle.xaml 4.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. <ResourceDictionary
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:customControl="clr-namespace:PDF_Master.CustomControl">
  5. <Style x:Key="FocusVisual">
  6. <Setter Property="Control.Template">
  7. <Setter.Value>
  8. <ControlTemplate>
  9. <Rectangle
  10. Margin="0"
  11. SnapsToDevicePixels="true"
  12. Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"
  13. StrokeDashArray="1 2"
  14. StrokeThickness="0" />
  15. </ControlTemplate>
  16. </Setter.Value>
  17. </Setter>
  18. </Style>
  19. <!-- set SelectedBackgroundColor to Transparent when you do not need the background in selected items -->
  20. <Color x:Key="SelectedBackgroundColor">LightBlue</Color>
  21. <Color x:Key="SelectedUnfocusedColor">AliceBlue</Color>
  22. <!-- set the MouseOverColor to Transparent when you do not need the effect in the unselected items -->
  23. <Color x:Key="MouseOverColor">LightBlue</Color>
  24. <SolidColorBrush x:Key="Item.MouseOver.Background" Color="LightBlue" />
  25. <SolidColorBrush x:Key="Item.MouseOver.Border" Color="LightBlue" />
  26. <SolidColorBrush x:Key="Item.SelectedInactive.Background" Color="AliceBlue" />
  27. <SolidColorBrush x:Key="Item.SelectedInactive.Border" Color="AliceBlue" />
  28. <SolidColorBrush x:Key="Item.SelectedActive.Background" Color="Beige" />
  29. <SolidColorBrush x:Key="Item.SelectedActive.Border" Color="Beige" />
  30. <Style x:Key="ListBoxItemStyle" TargetType="{x:Type customControl:ListItemQuickTool}">
  31. <Setter Property="SnapsToDevicePixels" Value="True" />
  32. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  33. <Setter Property="Template">
  34. <Setter.Value>
  35. <ControlTemplate TargetType="{x:Type customControl:ListItemQuickTool}">
  36. <Border
  37. x:Name="Border"
  38. Margin="0,0,0,16"
  39. Background="Transparent"
  40. BorderBrush="{StaticResource color.sys.border.neutral.lv3}"
  41. BorderThickness="1"
  42. CornerRadius="{StaticResource border-radius.8}"
  43. SnapsToDevicePixels="true">
  44. <ContentPresenter />
  45. </Border>
  46. <ControlTemplate.Triggers>
  47. <MultiTrigger>
  48. <MultiTrigger.Conditions>
  49. <Condition Property="IsOverModular" Value="True" />
  50. </MultiTrigger.Conditions>
  51. <Setter TargetName="Border" Property="Background" Value="{StaticResource Item.MouseOver.Background}" />
  52. <Setter TargetName="Border" Property="BorderBrush" Value="{StaticResource Item.MouseOver.Border}" />
  53. </MultiTrigger>
  54. </ControlTemplate.Triggers>
  55. </ControlTemplate>
  56. </Setter.Value>
  57. </Setter>
  58. <Style.Triggers />
  59. </Style>
  60. <Style x:Key="MoreListBoxItemStyle" TargetType="{x:Type customControl:ListItemQuickTool}">
  61. <Setter Property="SnapsToDevicePixels" Value="True" />
  62. <Setter Property="Template">
  63. <Setter.Value>
  64. <ControlTemplate TargetType="{x:Type customControl:ListItemQuickTool}">
  65. <Border
  66. x:Name="Border"
  67. Margin="0,0,0,16"
  68. Background="Transparent"
  69. BorderThickness="1"
  70. CornerRadius="4"
  71. SnapsToDevicePixels="False">
  72. <Border.BorderBrush>
  73. <SolidColorBrush Opacity="0.05" Color="#000000" />
  74. </Border.BorderBrush>
  75. <ContentPresenter />
  76. </Border>
  77. <ControlTemplate.Triggers>
  78. <MultiTrigger>
  79. <MultiTrigger.Conditions>
  80. <Condition Property="IsSelected" Value="true" />
  81. </MultiTrigger.Conditions>
  82. <MultiTrigger.Setters>
  83. <Setter TargetName="Border" Property="Background" Value="LightGoldenrodYellow" />
  84. </MultiTrigger.Setters>
  85. </MultiTrigger>
  86. </ControlTemplate.Triggers>
  87. </ControlTemplate>
  88. </Setter.Value>
  89. </Setter>
  90. </Style>
  91. </ResourceDictionary>