MesTabStyles.xaml 8.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  3. <SolidColorBrush x:Key="Win11WindowBrush" Color="#F5F6F8" />
  4. <SolidColorBrush x:Key="Win11CardBrush" Color="#FFFFFF" />
  5. <SolidColorBrush x:Key="Win11BorderBrush" Color="#DEE2E8" />
  6. <SolidColorBrush x:Key="Win11PrimaryBrush" Color="#2563EB" />
  7. <SolidColorBrush x:Key="Win11PrimaryHoverBrush" Color="#1D4ED8" />
  8. <SolidColorBrush x:Key="Win11TextBrush" Color="#111827" />
  9. <SolidColorBrush x:Key="Win11SubTextBrush" Color="#6B7280" />
  10. <SolidColorBrush x:Key="Win11DangerBrush" Color="#DC2626" />
  11. <SolidColorBrush x:Key="Win11SuccessBrush" Color="#16A34A" />
  12. <Style TargetType="Window">
  13. <Setter Property="Background" Value="{DynamicResource Win11WindowBrush}" />
  14. <Setter Property="FontFamily" Value="Microsoft YaHei UI" />
  15. <Setter Property="TextOptions.TextFormattingMode" Value="Display" />
  16. <Setter Property="TextOptions.TextRenderingMode" Value="ClearType" />
  17. </Style>
  18. <Style TargetType="TabControl">
  19. <Setter Property="Background" Value="Transparent" />
  20. <Setter Property="BorderThickness" Value="0" />
  21. <Setter Property="Padding" Value="8" />
  22. </Style>
  23. <Style TargetType="TabItem">
  24. <Setter Property="FontSize" Value="13" />
  25. <Setter Property="FontWeight" Value="SemiBold" />
  26. <Setter Property="Padding" Value="14,8" />
  27. <Setter Property="Margin" Value="0,0,6,0" />
  28. <Setter Property="Background" Value="#EDF1F7" />
  29. <Setter Property="Foreground" Value="{DynamicResource Win11SubTextBrush}" />
  30. </Style>
  31. <Style TargetType="GroupBox">
  32. <Setter Property="Margin" Value="0,0,0,10" />
  33. <Setter Property="Padding" Value="12" />
  34. <Setter Property="BorderBrush" Value="{DynamicResource Win11BorderBrush}" />
  35. <Setter Property="BorderThickness" Value="1" />
  36. <Setter Property="Background" Value="{DynamicResource Win11CardBrush}" />
  37. </Style>
  38. <Style x:Key="BaseActionButtonStyle" TargetType="Button">
  39. <Setter Property="MinWidth" Value="88" />
  40. <Setter Property="Height" Value="32" />
  41. <Setter Property="Padding" Value="14,0" />
  42. <Setter Property="Margin" Value="4,0,0,0" />
  43. <Setter Property="Foreground" Value="White" />
  44. <Setter Property="Background" Value="{DynamicResource Win11PrimaryBrush}" />
  45. <Setter Property="BorderBrush" Value="Transparent" />
  46. <Setter Property="BorderThickness" Value="1" />
  47. <Setter Property="Cursor" Value="Hand" />
  48. <Setter Property="Template">
  49. <Setter.Value>
  50. <ControlTemplate TargetType="Button">
  51. <Border x:Name="ButtonBorder"
  52. CornerRadius="8"
  53. Background="{TemplateBinding Background}"
  54. BorderBrush="{TemplateBinding BorderBrush}"
  55. BorderThickness="{TemplateBinding BorderThickness}">
  56. <ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
  57. </Border>
  58. <ControlTemplate.Triggers>
  59. <Trigger Property="IsMouseOver" Value="True">
  60. <Setter TargetName="ButtonBorder" Property="Opacity" Value="0.92" />
  61. </Trigger>
  62. <Trigger Property="IsPressed" Value="True">
  63. <Setter TargetName="ButtonBorder" Property="Opacity" Value="0.8" />
  64. </Trigger>
  65. <Trigger Property="IsEnabled" Value="False">
  66. <Setter TargetName="ButtonBorder" Property="Opacity" Value="0.45" />
  67. </Trigger>
  68. </ControlTemplate.Triggers>
  69. </ControlTemplate>
  70. </Setter.Value>
  71. </Setter>
  72. </Style>
  73. <Style TargetType="Button" BasedOn="{StaticResource BaseActionButtonStyle}" />
  74. <Style x:Key="SecondaryButtonStyle" TargetType="Button" BasedOn="{StaticResource BaseActionButtonStyle}">
  75. <Setter Property="Foreground" Value="{DynamicResource Win11TextBrush}" />
  76. <Setter Property="Background" Value="#EEF2F7" />
  77. </Style>
  78. <Style x:Key="DangerButtonStyle" TargetType="Button" BasedOn="{StaticResource BaseActionButtonStyle}">
  79. <Setter Property="Background" Value="{DynamicResource Win11DangerBrush}" />
  80. </Style>
  81. <Style x:Key="SuccessButtonStyle" TargetType="Button" BasedOn="{StaticResource BaseActionButtonStyle}">
  82. <Setter Property="Background" Value="{DynamicResource Win11SuccessBrush}" />
  83. </Style>
  84. <Style TargetType="TextBox">
  85. <Setter Property="Margin" Value="4" />
  86. <Setter Property="MinHeight" Value="32" />
  87. <Setter Property="Padding" Value="10,4" />
  88. <Setter Property="VerticalContentAlignment" Value="Center" />
  89. <Setter Property="Background" Value="{DynamicResource Win11CardBrush}" />
  90. <Setter Property="BorderBrush" Value="{DynamicResource Win11BorderBrush}" />
  91. <Setter Property="BorderThickness" Value="1" />
  92. </Style>
  93. <Style TargetType="ComboBox">
  94. <Setter Property="Margin" Value="4" />
  95. <Setter Property="MinHeight" Value="32" />
  96. <Setter Property="Padding" Value="8,2" />
  97. <Setter Property="Background" Value="{DynamicResource Win11CardBrush}" />
  98. <Setter Property="BorderBrush" Value="{DynamicResource Win11BorderBrush}" />
  99. <Setter Property="BorderThickness" Value="1" />
  100. </Style>
  101. <Style TargetType="Label">
  102. <Setter Property="Margin" Value="4,5,2,5" />
  103. <Setter Property="VerticalAlignment" Value="Center" />
  104. <Setter Property="Foreground" Value="{DynamicResource Win11SubTextBrush}" />
  105. </Style>
  106. <Style TargetType="DataGrid">
  107. <Setter Property="Margin" Value="0" />
  108. <Setter Property="AutoGenerateColumns" Value="False" />
  109. <Setter Property="CanUserAddRows" Value="False" />
  110. <Setter Property="CanUserDeleteRows" Value="False" />
  111. <Setter Property="CanUserResizeRows" Value="False" />
  112. <Setter Property="CanUserReorderColumns" Value="False" />
  113. <Setter Property="IsReadOnly" Value="True" />
  114. <Setter Property="HeadersVisibility" Value="Column" />
  115. <Setter Property="GridLinesVisibility" Value="Horizontal" />
  116. <Setter Property="BorderBrush" Value="{DynamicResource Win11BorderBrush}" />
  117. <Setter Property="BorderThickness" Value="1" />
  118. <Setter Property="RowBackground" Value="{DynamicResource Win11CardBrush}" />
  119. <Setter Property="AlternatingRowBackground" Value="#F8FAFC" />
  120. <Setter Property="HorizontalGridLinesBrush" Value="#EEF2F7" />
  121. <Setter Property="ColumnHeaderStyle">
  122. <Setter.Value>
  123. <Style TargetType="DataGridColumnHeader">
  124. <Setter Property="Background" Value="#EEF2F7" />
  125. <Setter Property="Foreground" Value="{DynamicResource Win11SubTextBrush}" />
  126. <Setter Property="FontWeight" Value="SemiBold" />
  127. <Setter Property="HorizontalContentAlignment" Value="Center" />
  128. <Setter Property="Padding" Value="8,6" />
  129. </Style>
  130. </Setter.Value>
  131. </Setter>
  132. <Setter Property="RowStyle">
  133. <Setter.Value>
  134. <Style TargetType="DataGridRow">
  135. <Style.Triggers>
  136. <Trigger Property="IsMouseOver" Value="True">
  137. <Setter Property="Background" Value="#EEF4FF" />
  138. </Trigger>
  139. <Trigger Property="IsSelected" Value="True">
  140. <Setter Property="Background" Value="#E8F0FE" />
  141. <Setter Property="Foreground" Value="{DynamicResource Win11TextBrush}" />
  142. </Trigger>
  143. </Style.Triggers>
  144. </Style>
  145. </Setter.Value>
  146. </Setter>
  147. </Style>
  148. <Style TargetType="StatusBar">
  149. <Setter Property="Background" Value="#EEF2F7" />
  150. <Setter Property="BorderBrush" Value="{DynamicResource Win11BorderBrush}" />
  151. <Setter Property="BorderThickness" Value="1" />
  152. <Setter Property="Padding" Value="8,2" />
  153. </Style>
  154. </ResourceDictionary>