Label.xaml 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  2. <ResourceDictionary.MergedDictionaries>
  3. <ResourceDictionary Source="BaseStyle.xaml" />
  4. </ResourceDictionary.MergedDictionaries>
  5. <!-- 基样式 -->
  6. <Style
  7. x:Key="LabelBaseStyle"
  8. BasedOn="{StaticResource BaseStyle}"
  9. TargetType="{x:Type Label}">
  10. <Setter Property="Padding" Value="0" />
  11. </Style>
  12. <!-- 默认样式 -->
  13. <Style BasedOn="{StaticResource LabelBaseStyle}" TargetType="{x:Type Label}" />
  14. <!-- 标题 源码行数:990-1104 -->
  15. <!-- 标题 -->
  16. <!-- 基样式 -->
  17. <Style
  18. x:Key="HBaseStyle"
  19. BasedOn="{StaticResource LabelBaseStyle}"
  20. TargetType="{x:Type Label}">
  21. <Setter Property="FontWeight" Value="{DynamicResource HFontWeight}" />
  22. <Setter Property="Foreground" Value="{DynamicResource DefaultForeground}" />
  23. <Setter Property="Margin" Value="{DynamicResource HMargin}" />
  24. </Style>
  25. <Style
  26. x:Key="h1"
  27. BasedOn="{StaticResource HBaseStyle}"
  28. TargetType="{x:Type Label}">
  29. <Setter Property="FontSize" Value="{DynamicResource H1FontSize}" />
  30. </Style>
  31. <Style
  32. x:Key="h2"
  33. BasedOn="{StaticResource HBaseStyle}"
  34. TargetType="{x:Type Label}">
  35. <Setter Property="FontSize" Value="{DynamicResource H2FontSize}" />
  36. </Style>
  37. <Style
  38. x:Key="h3"
  39. BasedOn="{StaticResource HBaseStyle}"
  40. TargetType="{x:Type Label}">
  41. <Setter Property="FontSize" Value="{DynamicResource H3FontSize}" />
  42. </Style>
  43. <Style
  44. x:Key="h4"
  45. BasedOn="{StaticResource HBaseStyle}"
  46. TargetType="{x:Type Label}">
  47. <Setter Property="FontSize" Value="{DynamicResource H4FontSize}" />
  48. </Style>
  49. <Style
  50. x:Key="h5"
  51. BasedOn="{StaticResource HBaseStyle}"
  52. TargetType="{x:Type Label}">
  53. <Setter Property="FontSize" Value="{DynamicResource H5FontSize}" />
  54. </Style>
  55. <Style
  56. x:Key="h6"
  57. BasedOn="{StaticResource HBaseStyle}"
  58. TargetType="{x:Type Label}">
  59. <Setter Property="FontSize" Value="{DynamicResource H6FontSize}" />
  60. </Style>
  61. <!-- 副标题 -->
  62. <!-- 基样式 -->
  63. <Style
  64. x:Key="SmallBaseStyle"
  65. BasedOn="{StaticResource LabelBaseStyle}"
  66. TargetType="{x:Type Label}">
  67. <Setter Property="FontWeight" Value="{DynamicResource SmallFontWeight}" />
  68. <Setter Property="Foreground" Value="{DynamicResource SmallForeground}" />
  69. <Setter Property="Margin" Value="{DynamicResource SmallMargin}" />
  70. <Setter Property="VerticalAlignment" Value="Bottom" />
  71. </Style>
  72. <Style
  73. x:Key="h1 small"
  74. BasedOn="{StaticResource SmallBaseStyle}"
  75. TargetType="{x:Type Label}">
  76. <Setter Property="FontSize" Value="{DynamicResource H1SmallFontSize}" />
  77. </Style>
  78. <Style
  79. x:Key="h2 small"
  80. BasedOn="{StaticResource SmallBaseStyle}"
  81. TargetType="{x:Type Label}">
  82. <Setter Property="FontSize" Value="{DynamicResource H2SmallFontSize}" />
  83. </Style>
  84. <Style
  85. x:Key="h3 small"
  86. BasedOn="{StaticResource SmallBaseStyle}"
  87. TargetType="{x:Type Label}">
  88. <Setter Property="FontSize" Value="{DynamicResource H3SmallFontSize}" />
  89. </Style>
  90. <Style
  91. x:Key="h4 small"
  92. BasedOn="{StaticResource SmallBaseStyle}"
  93. TargetType="{x:Type Label}">
  94. <Setter Property="FontSize" Value="{DynamicResource H4SmallFontSize}" />
  95. </Style>
  96. <Style
  97. x:Key="h5 small"
  98. BasedOn="{StaticResource SmallBaseStyle}"
  99. TargetType="{x:Type Label}">
  100. <Setter Property="FontSize" Value="{DynamicResource H5SmallFontSize}" />
  101. </Style>
  102. <Style
  103. x:Key="h6 small"
  104. BasedOn="{StaticResource SmallBaseStyle}"
  105. TargetType="{x:Type Label}">
  106. <Setter Property="FontSize" Value="{DynamicResource H6SmallFontSize}" />
  107. </Style>
  108. <!-- 语境 源码行数:1128-1215 -->
  109. <!-- 前景 -->
  110. <Style
  111. x:Key="text-muted"
  112. BasedOn="{StaticResource LabelBaseStyle}"
  113. TargetType="{x:Type Label}">
  114. <Setter Property="Foreground" Value="{DynamicResource Foreground-Muted}" />
  115. </Style>
  116. <Style
  117. x:Key="text-primary"
  118. BasedOn="{StaticResource LabelBaseStyle}"
  119. TargetType="{x:Type Label}">
  120. <Setter Property="Foreground" Value="{DynamicResource Foreground-Primary2}" />
  121. </Style>
  122. <Style
  123. x:Key="text-success"
  124. BasedOn="{StaticResource LabelBaseStyle}"
  125. TargetType="{x:Type Label}">
  126. <Setter Property="Foreground" Value="{DynamicResource Foreground-Success}" />
  127. </Style>
  128. <Style
  129. x:Key="text-info"
  130. BasedOn="{StaticResource LabelBaseStyle}"
  131. TargetType="{x:Type Label}">
  132. <Setter Property="Foreground" Value="{DynamicResource Foreground-Info}" />
  133. </Style>
  134. <Style
  135. x:Key="text-warning"
  136. BasedOn="{StaticResource LabelBaseStyle}"
  137. TargetType="{x:Type Label}">
  138. <Setter Property="Foreground" Value="{DynamicResource Foreground-Warning}" />
  139. </Style>
  140. <Style
  141. x:Key="text-danger"
  142. BasedOn="{StaticResource LabelBaseStyle}"
  143. TargetType="{x:Type Label}">
  144. <Setter Property="Foreground" Value="{DynamicResource Foreground-Danger}" />
  145. </Style>
  146. <!-- 背景 -->
  147. <Style
  148. x:Key="text bg-primary"
  149. BasedOn="{StaticResource LabelBaseStyle}"
  150. TargetType="{x:Type Label}">
  151. <Setter Property="Foreground" Value="{DynamicResource Foreground-Primary1}" />
  152. <Setter Property="Background" Value="{DynamicResource Background-Primary2}" />
  153. </Style>
  154. <Style
  155. x:Key="text bg-success"
  156. BasedOn="{StaticResource LabelBaseStyle}"
  157. TargetType="{x:Type Label}">
  158. <Setter Property="Background" Value="{DynamicResource Background-Success2}" />
  159. </Style>
  160. <Style
  161. x:Key="text bg-info"
  162. BasedOn="{StaticResource LabelBaseStyle}"
  163. TargetType="{x:Type Label}">
  164. <Setter Property="Background" Value="{DynamicResource Background-Info2}" />
  165. </Style>
  166. <Style
  167. x:Key="text bg-warning"
  168. BasedOn="{StaticResource LabelBaseStyle}"
  169. TargetType="{x:Type Label}">
  170. <Setter Property="Background" Value="{DynamicResource Background-Warning2}" />
  171. </Style>
  172. <Style
  173. x:Key="text bg-danger"
  174. BasedOn="{StaticResource LabelBaseStyle}"
  175. TargetType="{x:Type Label}">
  176. <Setter Property="Background" Value="{DynamicResource Background-Danger2}" />
  177. </Style>
  178. <!-- code 源码行数:1336-1389 -->
  179. <!-- Label -->
  180. <Style
  181. x:Key="CodeBaseStyle"
  182. BasedOn="{x:Null}"
  183. TargetType="{x:Type Label}">
  184. <Setter Property="FontFamily" Value="Menlo, Monaco, Consolas,Courier New, monospace" />
  185. <Setter Property="FontSize" Value="{DynamicResource CodeFontSize}" />
  186. <Setter Property="BorderThickness" Value="0" />
  187. <Setter Property="HorizontalAlignment" Value="Center" />
  188. <Setter Property="VerticalAlignment" Value="Center" />
  189. <Setter Property="Margin" Value="0" />
  190. <Setter Property="Padding" Value="{DynamicResource CodePadding}" />
  191. </Style>
  192. <!-- 代码 -->
  193. <Style
  194. x:Key="code"
  195. BasedOn="{StaticResource CodeBaseStyle}"
  196. TargetType="{x:Type Label}">
  197. <Setter Property="Foreground" Value="#c7254e" />
  198. <Setter Property="Background" Value="#f9f2f4" />
  199. <Setter Property="Template">
  200. <Setter.Value>
  201. <ControlTemplate TargetType="{x:Type Label}">
  202. <Border
  203. Padding="{TemplateBinding Padding}"
  204. Background="{TemplateBinding Background}"
  205. BorderBrush="{TemplateBinding BorderBrush}"
  206. BorderThickness="{TemplateBinding BorderThickness}"
  207. CornerRadius="4"
  208. SnapsToDevicePixels="True">
  209. <ContentPresenter
  210. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  211. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  212. Content="{TemplateBinding Content}"
  213. ContentStringFormat="{TemplateBinding ContentStringFormat}"
  214. ContentTemplate="{TemplateBinding ContentTemplate}"
  215. RecognizesAccessKey="True"
  216. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  217. </Border>
  218. </ControlTemplate>
  219. </Setter.Value>
  220. </Setter>
  221. </Style>
  222. <!-- 键盘 -->
  223. <Style
  224. x:Key="kbd"
  225. BasedOn="{StaticResource CodeBaseStyle}"
  226. TargetType="{x:Type Label}">
  227. <Setter Property="Foreground" Value="#fff" />
  228. <Setter Property="Background" Value="#333" />
  229. <Setter Property="Template">
  230. <Setter.Value>
  231. <ControlTemplate TargetType="{x:Type Label}">
  232. <Border
  233. Padding="{TemplateBinding Padding}"
  234. Background="{TemplateBinding Background}"
  235. BorderBrush="{TemplateBinding BorderBrush}"
  236. BorderThickness="{TemplateBinding BorderThickness}"
  237. CornerRadius="3"
  238. SnapsToDevicePixels="True">
  239. <ContentPresenter
  240. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  241. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  242. Content="{TemplateBinding Content}"
  243. ContentStringFormat="{TemplateBinding ContentStringFormat}"
  244. ContentTemplate="{TemplateBinding ContentTemplate}"
  245. RecognizesAccessKey="True"
  246. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  247. </Border>
  248. </ControlTemplate>
  249. </Setter.Value>
  250. </Setter>
  251. </Style>
  252. <!-- 代码块 -->
  253. <Style
  254. x:Key="pre"
  255. BasedOn="{StaticResource CodeBaseStyle}"
  256. TargetType="{x:Type Label}">
  257. <Setter Property="Foreground" Value="#333" />
  258. <Setter Property="Background" Value="#f5f5f5" />
  259. <Setter Property="BorderBrush" Value="#ccc" />
  260. <Setter Property="BorderThickness" Value="1" />
  261. <Setter Property="HorizontalAlignment" Value="Stretch" />
  262. <Setter Property="VerticalAlignment" Value="Top" />
  263. <Setter Property="Margin" Value="0,0,0,10" />
  264. <Setter Property="Padding" Value="9.5" />
  265. <Setter Property="Template">
  266. <Setter.Value>
  267. <ControlTemplate TargetType="{x:Type Label}">
  268. <Border
  269. Padding="{TemplateBinding Padding}"
  270. Background="{TemplateBinding Background}"
  271. BorderBrush="{TemplateBinding BorderBrush}"
  272. BorderThickness="{TemplateBinding BorderThickness}"
  273. CornerRadius="4"
  274. SnapsToDevicePixels="True">
  275. <ContentPresenter
  276. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  277. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  278. Content="{TemplateBinding Content}"
  279. ContentStringFormat="{TemplateBinding ContentStringFormat}"
  280. ContentTemplate="{TemplateBinding ContentTemplate}"
  281. RecognizesAccessKey="True"
  282. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  283. </Border>
  284. </ControlTemplate>
  285. </Setter.Value>
  286. </Setter>
  287. </Style>
  288. <!-- 辅助文本 源码行数:2690-2695 -->
  289. <Style
  290. x:Key="help-block"
  291. BasedOn="{StaticResource LabelBaseStyle}"
  292. TargetType="{x:Type Label}">
  293. <Setter Property="Foreground" Value="#737373" />
  294. </Style>
  295. </ResourceDictionary>