CommonStyle.xaml 5.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:hc="https://handyorg.github.io/handycontrol">
  4. <!--整体样式-->
  5. <Style x:Key="BorderBG" TargetType="Border">
  6. <Style.Setters>
  7. <Setter Property="Background">
  8. <Setter.Value>
  9. <LinearGradientBrush Opacity="0.97">
  10. <GradientStop Color="#EBF7E3" Offset="0"/>
  11. <GradientStop Color="#A8E4C0" Offset="1"/>
  12. </LinearGradientBrush>
  13. </Setter.Value>
  14. </Setter>
  15. <Setter Property="CornerRadius" Value="8"/>
  16. <Setter Property="BorderThickness" Value="0"/>
  17. </Style.Setters>
  18. </Style>
  19. <LinearGradientBrush x:Key="BtnBG" Opacity="0.7">
  20. <GradientStop Color="White" Offset="0"/>
  21. <GradientStop Color="White" Offset="1"/>
  22. </LinearGradientBrush>
  23. <!--按钮样式-->
  24. <Style x:Key="MyBtnStyle" TargetType="Button" BasedOn="{StaticResource ButtonInfo}">
  25. <Setter Property="Background" Value="{StaticResource BtnBG}"/>
  26. <Setter Property="BorderThickness" Value="0"/>
  27. <Setter Property="BorderBrush">
  28. <Setter.Value>
  29. <SolidColorBrush Color="#E5E5E2"/>
  30. </Setter.Value>
  31. </Setter>
  32. <Setter Property="Foreground" Value="Black"/>
  33. <Style.Triggers>
  34. <Trigger Property="IsMouseOver" Value="True">
  35. <Setter Property="Background">
  36. <Setter.Value>
  37. <LinearGradientBrush Opacity="1">
  38. <GradientStop Color="White" Offset="0"/>
  39. <GradientStop Color="White" Offset="1"/>
  40. </LinearGradientBrush>
  41. </Setter.Value>
  42. </Setter>
  43. </Trigger>
  44. <Trigger Property="IsPressed" Value="true">
  45. <Setter Property="Opacity" Value="1"/>
  46. </Trigger>
  47. </Style.Triggers>
  48. </Style>
  49. <!--CheckBox样式-->
  50. <Style x:Key="MyCheckBoxStyle" TargetType="CheckBox" BasedOn="{StaticResource CheckBoxBaseStyle}">
  51. <Setter Property="Background">
  52. <Setter.Value>
  53. <LinearGradientBrush EndPoint="1,0" StartPoint="0,0" Opacity="0.6">
  54. <GradientStop Color="#FF9EA3A6"/>
  55. </LinearGradientBrush>
  56. </Setter.Value>
  57. </Setter>
  58. <Setter Property="BorderThickness" Value="0"/>
  59. <Style.Triggers>
  60. <Trigger Property="IsChecked" Value="True">
  61. <Setter Property="Background">
  62. <Setter.Value>
  63. <LinearGradientBrush EndPoint="1,0" StartPoint="0,0" Opacity="0.6">
  64. <GradientStop Color="#FF9EA3A6"/>
  65. </LinearGradientBrush>
  66. </Setter.Value>
  67. </Setter>
  68. </Trigger>
  69. <Trigger Property="IsMouseOver" Value="True">
  70. <Setter Property="Background">
  71. <Setter.Value>
  72. <LinearGradientBrush EndPoint="1,0" StartPoint="0,0" Opacity="0.7">
  73. <GradientStop Color="#FF9EA3A6"/>
  74. </LinearGradientBrush>
  75. </Setter.Value>
  76. </Setter>
  77. </Trigger>
  78. </Style.Triggers>
  79. </Style>
  80. <!--菜单样式-->
  81. <Style x:Key="MyMenuStyle" TargetType="hc:SideMenuItem" BasedOn="{StaticResource SideMenuItemBaseStyle}">
  82. <Style.Setters>
  83. <Setter Property="Background" Value="Transparent"/>
  84. </Style.Setters>
  85. <Style.Triggers>
  86. <Trigger Property="IsMouseOver" Value="True">
  87. <Setter Property="Background" Value="Transparent"/>
  88. </Trigger>
  89. <Trigger Property="IsSelected" Value="True">
  90. <Setter Property="Background" Value="Transparent"/>
  91. </Trigger>
  92. </Style.Triggers>
  93. </Style>
  94. <!--radio btn style-->
  95. <Style x:Key="MyRadioBtnStyle" TargetType="RadioButton" BasedOn="{StaticResource RadioButtonIcon}">
  96. <Setter Property="Background">
  97. <Setter.Value>
  98. <SolidColorBrush Color="White" Opacity="0.7"/>
  99. </Setter.Value>
  100. </Setter>
  101. <Style.Triggers>
  102. <Trigger Property="IsMouseOver" Value="True">
  103. <Setter Property="Background">
  104. <Setter.Value>
  105. <SolidColorBrush Color="White" Opacity="1"/>
  106. </Setter.Value>
  107. </Setter>
  108. </Trigger>
  109. </Style.Triggers>
  110. </Style>
  111. <!--text box style-->
  112. <Style x:Key="MyTextBoxStyle" TargetType="TextBox" BasedOn="{StaticResource TextBoxBaseStyle}">
  113. <Setter Property="Background">
  114. <Setter.Value>
  115. <SolidColorBrush Color="White" Opacity="0.7"/>
  116. </Setter.Value>
  117. </Setter>
  118. <Setter Property="BorderThickness" Value="0" />
  119. <Style.Triggers>
  120. <Trigger Property="IsFocused" Value="True">
  121. <Setter Property="BorderThickness" Value="0" />
  122. </Trigger>
  123. </Style.Triggers>
  124. </Style>
  125. </ResourceDictionary>