ToggleButton.xaml 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
  2. <!-- Design Token for subtool -->
  3. <Style x:Key="LinkToolbarTgb" TargetType="{x:Type ToggleButton}">
  4. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  5. <Setter Property="Background" Value="Transparent" />
  6. <Setter Property="BorderThickness" Value="0" />
  7. <Setter Property="Template">
  8. <Setter.Value>
  9. <ControlTemplate TargetType="{x:Type ToggleButton}">
  10. <Border
  11. x:Name="border"
  12. Background="{TemplateBinding Panel.Background}"
  13. BorderBrush="{StaticResource color.field.border.norm}"
  14. BorderThickness="1"
  15. CornerRadius="{StaticResource border-radius.4}"
  16. SnapsToDevicePixels="True">
  17. <ContentPresenter
  18. x:Name="contentPresenter"
  19. Margin="{TemplateBinding Padding}"
  20. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  21. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  22. Content="{TemplateBinding Content}"
  23. ContentStringFormat="{TemplateBinding ContentStringFormat}"
  24. ContentTemplate="{TemplateBinding ContentTemplate}"
  25. Focusable="False"
  26. RecognizesAccessKey="True"
  27. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  28. </Border>
  29. <ControlTemplate.Triggers>
  30. <Trigger Property="IsMouseOver" Value="True">
  31. <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource color.field.border.focus}" />
  32. <!--<Setter TargetName="border" Property="Panel.Background" Value="{StaticResource color.field.border.focus}" />-->
  33. </Trigger>
  34. <Trigger Property="IsPressed" Value="True">
  35. <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource color.field.border.focus}" />
  36. </Trigger>
  37. <Trigger Property="IsChecked" Value="True">
  38. <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource color.field.border.focus}" />
  39. </Trigger>
  40. <Trigger Property="IsChecked" Value="False">
  41. <Setter TargetName="border" Property="BorderBrush" Value="{StaticResource color.field.border.norm}" />
  42. </Trigger>
  43. <Trigger Property="IsEnabled" Value="False">
  44. <Setter TargetName="border" Property="Panel.Background" Value="Transparent" />
  45. </Trigger>
  46. </ControlTemplate.Triggers>
  47. </ControlTemplate>
  48. </Setter.Value>
  49. </Setter>
  50. </Style>
  51. <Style x:Key="SubToolbarTgb" TargetType="{x:Type ToggleButton}">
  52. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  53. <Setter Property="Background" Value="Transparent" />
  54. <Setter Property="BorderThickness" Value="0" />
  55. <Setter Property="Foreground" Value="{StaticResource color.icon.base.neutral.norm.lv1}" />
  56. <Setter Property="Template">
  57. <Setter.Value>
  58. <ControlTemplate TargetType="{x:Type ToggleButton}">
  59. <Border
  60. x:Name="border"
  61. Background="{TemplateBinding Panel.Background}"
  62. BorderBrush="{TemplateBinding Border.BorderBrush}"
  63. BorderThickness="{TemplateBinding Border.BorderThickness}"
  64. CornerRadius="{StaticResource border-radius.4}"
  65. SnapsToDevicePixels="True">
  66. <ContentPresenter
  67. x:Name="contentPresenter"
  68. Margin="{TemplateBinding Padding}"
  69. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  70. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  71. Content="{TemplateBinding Content}"
  72. ContentStringFormat="{TemplateBinding ContentStringFormat}"
  73. ContentTemplate="{TemplateBinding ContentTemplate}"
  74. Focusable="False"
  75. RecognizesAccessKey="True"
  76. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  77. </Border>
  78. <ControlTemplate.Triggers>
  79. <Trigger Property="IsMouseOver" Value="True">
  80. <Setter TargetName="border" Property="Panel.Background" Value="{StaticResource color.item-state.hov.bg}" />
  81. </Trigger>
  82. <Trigger Property="IsPressed" Value="True">
  83. <Setter TargetName="border" Property="Panel.Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
  84. </Trigger>
  85. <Trigger Property="IsChecked" Value="True">
  86. <Setter TargetName="border" Property="Panel.Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
  87. <Setter Property="Foreground" Value="{StaticResource color.icon.base.neutral.sel}" />
  88. </Trigger>
  89. <Trigger Property="IsEnabled" Value="False">
  90. <Setter TargetName="border" Property="Panel.Background" Value="Transparent" />
  91. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.dis}" />
  92. </Trigger>
  93. </ControlTemplate.Triggers>
  94. </ControlTemplate>
  95. </Setter.Value>
  96. </Setter>
  97. </Style>
  98. <Style x:Key="infoText1" TargetType="{x:Type ToggleButton}">
  99. <Setter Property="Background" Value="{StaticResource color.btn.sec.bg.norm}" />
  100. <Setter Property="Foreground" Value="{StaticResource color.btn.sec.text.def}" />
  101. <Setter Property="BorderBrush" Value="{StaticResource color.btn.sec.border-color}" />
  102. <Setter Property="BorderThickness" Value="0" />
  103. <Setter Property="Template">
  104. <Setter.Value>
  105. <ControlTemplate TargetType="{x:Type ToggleButton}">
  106. <Border
  107. x:Name="border"
  108. Background="{TemplateBinding Panel.Background}"
  109. BorderBrush="{TemplateBinding Border.BorderBrush}"
  110. BorderThickness="{TemplateBinding Border.BorderThickness}"
  111. CornerRadius="{StaticResource border-radius.4}"
  112. SnapsToDevicePixels="True">
  113. <Grid
  114. x:Name="grid"
  115. HorizontalAlignment="Center"
  116. VerticalAlignment="Center"
  117. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
  118. <StackPanel x:Name="state1" Visibility="Collapsed">
  119. <Rectangle
  120. Width="14"
  121. Height="1.5"
  122. HorizontalAlignment="Left"
  123. Fill="#252629" />
  124. <Rectangle
  125. Width="8"
  126. Height="1.5"
  127. Margin="0,2.5"
  128. HorizontalAlignment="Left"
  129. Fill="#252629" />
  130. <Rectangle
  131. Width="14"
  132. Height="1.5"
  133. Margin="0,0,0,2.5"
  134. HorizontalAlignment="Left"
  135. Fill="#252629" />
  136. <Rectangle
  137. Width="8"
  138. Height="1.5"
  139. HorizontalAlignment="Left"
  140. Fill="#252629" />
  141. </StackPanel>
  142. <StackPanel
  143. x:Name="state2"
  144. HorizontalAlignment="Center"
  145. VerticalAlignment="Center">
  146. <Rectangle
  147. Width="14"
  148. Height="1.5"
  149. HorizontalAlignment="Left"
  150. Fill="#616469" />
  151. <Rectangle
  152. Width="8"
  153. Height="1.5"
  154. Margin="0,2.5"
  155. HorizontalAlignment="Left"
  156. Fill="#616469" />
  157. <Rectangle
  158. Width="14"
  159. Height="1.5"
  160. Margin="0,0,0,2.5"
  161. HorizontalAlignment="Left"
  162. Fill="#616469" />
  163. <Rectangle
  164. Width="8"
  165. Height="1.5"
  166. HorizontalAlignment="Left"
  167. Fill="#616469" />
  168. </StackPanel>
  169. </Grid>
  170. </Border>
  171. <ControlTemplate.Triggers>
  172. <Trigger Property="IsMouseOver" Value="True">
  173. <Setter TargetName="state2" Property="Visibility" Value="Visible" />
  174. <Setter TargetName="state1" Property="Visibility" Value="Collapsed" />
  175. <Setter TargetName="border" Property="Background" Value="#EDEEF0" />
  176. </Trigger>
  177. <Trigger Property="IsChecked" Value="True">
  178. <Setter TargetName="state1" Property="Visibility" Value="Visible" />
  179. <Setter TargetName="state2" Property="Visibility" Value="Collapsed" />
  180. <Setter TargetName="border" Property="Background" Value="#CED0D4" />
  181. <!--<Setter TargetName="border" Property="BorderBrush" Value="{StaticResource color.btn.sec.border-color}" />
  182. <Setter TargetName="border" Property="BorderThickness" Value="{StaticResource border-width.1}" />-->
  183. </Trigger>
  184. <Trigger Property="IsEnabled" Value="False">
  185. <Setter TargetName="state1" Property="Visibility" Value="Collapsed" />
  186. </Trigger>
  187. </ControlTemplate.Triggers>
  188. </ControlTemplate>
  189. </Setter.Value>
  190. </Setter>
  191. </Style>
  192. <Style x:Key="infoText2" TargetType="{x:Type ToggleButton}">
  193. <Setter Property="Background" Value="{StaticResource color.btn.sec.bg.norm}" />
  194. <Setter Property="Foreground" Value="{StaticResource color.btn.sec.text.def}" />
  195. <Setter Property="BorderBrush" Value="{StaticResource color.btn.sec.border-color}" />
  196. <Setter Property="BorderThickness" Value="0" />
  197. <Setter Property="Template">
  198. <Setter.Value>
  199. <ControlTemplate TargetType="{x:Type ToggleButton}">
  200. <Border
  201. x:Name="border"
  202. Background="{TemplateBinding Panel.Background}"
  203. BorderBrush="{TemplateBinding Border.BorderBrush}"
  204. BorderThickness="{TemplateBinding Border.BorderThickness}"
  205. CornerRadius="{StaticResource border-radius.4}"
  206. SnapsToDevicePixels="True">
  207. <Grid
  208. x:Name="grid"
  209. HorizontalAlignment="Center"
  210. VerticalAlignment="Center"
  211. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
  212. <StackPanel x:Name="state1" Visibility="Collapsed">
  213. <Rectangle
  214. Width="14"
  215. Height="1.5"
  216. HorizontalAlignment="Center"
  217. Fill="#252629" />
  218. <Rectangle
  219. Width="8"
  220. Height="1.5"
  221. Margin="0,2.5"
  222. HorizontalAlignment="Center"
  223. Fill="#252629" />
  224. <Rectangle
  225. Width="14"
  226. Height="1.5"
  227. Margin="0,0,0,2.5"
  228. HorizontalAlignment="Center"
  229. Fill="#252629" />
  230. <Rectangle
  231. Width="8"
  232. Height="1.5"
  233. HorizontalAlignment="Center"
  234. Fill="#252629" />
  235. </StackPanel>
  236. <StackPanel
  237. x:Name="state2"
  238. HorizontalAlignment="Center"
  239. VerticalAlignment="Center">
  240. <Rectangle
  241. Width="14"
  242. Height="1.5"
  243. HorizontalAlignment="Center"
  244. Fill="#616469" />
  245. <Rectangle
  246. Width="8"
  247. Height="1.5"
  248. Margin="0,2.5"
  249. HorizontalAlignment="Center"
  250. Fill="#616469" />
  251. <Rectangle
  252. Width="14"
  253. Height="1.5"
  254. Margin="0,0,0,2.5"
  255. HorizontalAlignment="Center"
  256. Fill="#616469" />
  257. <Rectangle
  258. Width="8"
  259. Height="1.5"
  260. HorizontalAlignment="Center"
  261. Fill="#616469" />
  262. </StackPanel>
  263. </Grid>
  264. </Border>
  265. <ControlTemplate.Triggers>
  266. <Trigger Property="IsMouseOver" Value="True">
  267. <Setter TargetName="state2" Property="Visibility" Value="Visible" />
  268. <Setter TargetName="state1" Property="Visibility" Value="Collapsed" />
  269. <Setter TargetName="border" Property="Background" Value="#EDEEF0" />
  270. </Trigger>
  271. <Trigger Property="IsChecked" Value="True">
  272. <Setter TargetName="state1" Property="Visibility" Value="Visible" />
  273. <Setter TargetName="state2" Property="Visibility" Value="Collapsed" />
  274. <Setter TargetName="border" Property="Background" Value="#CED0D4" />
  275. <!--<Setter TargetName="border" Property="BorderBrush" Value="{StaticResource color.btn.sec.border-color}" />
  276. <Setter TargetName="border" Property="BorderThickness" Value="{StaticResource border-width.1}" />-->
  277. </Trigger>
  278. <Trigger Property="IsEnabled" Value="False">
  279. <Setter TargetName="state1" Property="Visibility" Value="Collapsed" />
  280. </Trigger>
  281. </ControlTemplate.Triggers>
  282. </ControlTemplate>
  283. </Setter.Value>
  284. </Setter>
  285. </Style>
  286. <Style x:Key="infoText3" TargetType="{x:Type ToggleButton}">
  287. <Setter Property="Background" Value="{StaticResource color.btn.sec.bg.norm}" />
  288. <Setter Property="Foreground" Value="{StaticResource color.btn.sec.text.def}" />
  289. <Setter Property="BorderBrush" Value="{StaticResource color.btn.sec.border-color}" />
  290. <Setter Property="BorderThickness" Value="0" />
  291. <Setter Property="VerticalAlignment" Value="Center" />
  292. <Setter Property="HorizontalAlignment" Value="Center" />
  293. <Setter Property="Template">
  294. <Setter.Value>
  295. <ControlTemplate TargetType="{x:Type ToggleButton}">
  296. <Border
  297. x:Name="border"
  298. Background="{TemplateBinding Panel.Background}"
  299. BorderBrush="{TemplateBinding Border.BorderBrush}"
  300. BorderThickness="{TemplateBinding Border.BorderThickness}"
  301. CornerRadius="{StaticResource border-radius.4}"
  302. SnapsToDevicePixels="True">
  303. <Grid
  304. x:Name="grid"
  305. HorizontalAlignment="Center"
  306. VerticalAlignment="Center"
  307. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
  308. <StackPanel
  309. x:Name="state1"
  310. HorizontalAlignment="Center"
  311. VerticalAlignment="Center"
  312. Visibility="Collapsed">
  313. <Rectangle
  314. Width="14"
  315. Height="1.5"
  316. HorizontalAlignment="Right"
  317. Fill="#252629" />
  318. <Rectangle
  319. Width="8"
  320. Height="1.5"
  321. Margin="0,2.5"
  322. HorizontalAlignment="Right"
  323. Fill="#252629" />
  324. <Rectangle
  325. Width="14"
  326. Height="1.5"
  327. Margin="0,0,0,2.5"
  328. HorizontalAlignment="Right"
  329. Fill="#252629" />
  330. <Rectangle
  331. Width="8"
  332. Height="1.5"
  333. HorizontalAlignment="Right"
  334. Fill="#252629" />
  335. </StackPanel>
  336. <StackPanel
  337. x:Name="state2"
  338. HorizontalAlignment="Center"
  339. VerticalAlignment="Center">
  340. <Rectangle
  341. Width="14"
  342. Height="1.5"
  343. HorizontalAlignment="Right"
  344. Fill="#616469" />
  345. <Rectangle
  346. Width="8"
  347. Height="1.5"
  348. Margin="0,2.5"
  349. HorizontalAlignment="Right"
  350. Fill="#616469" />
  351. <Rectangle
  352. Width="14"
  353. Height="1.5"
  354. Margin="0,0,0,2.5"
  355. HorizontalAlignment="Right"
  356. Fill="#616469" />
  357. <Rectangle
  358. Width="8"
  359. Height="1.5"
  360. HorizontalAlignment="Right"
  361. Fill="#616469" />
  362. </StackPanel>
  363. </Grid>
  364. </Border>
  365. <ControlTemplate.Triggers>
  366. <Trigger Property="IsMouseOver" Value="True">
  367. <Setter TargetName="state2" Property="Visibility" Value="Visible" />
  368. <Setter TargetName="state1" Property="Visibility" Value="Collapsed" />
  369. <Setter TargetName="border" Property="Background" Value="#EDEEF0" />
  370. </Trigger>
  371. <Trigger Property="IsChecked" Value="True">
  372. <Setter TargetName="state1" Property="Visibility" Value="Visible" />
  373. <Setter TargetName="state2" Property="Visibility" Value="Collapsed" />
  374. <Setter TargetName="border" Property="Background" Value="#CED0D4" />
  375. <!--<Setter TargetName="border" Property="BorderBrush" Value="{StaticResource color.btn.sec.border-color}" />
  376. <Setter TargetName="border" Property="BorderThickness" Value="{StaticResource border-width.1}" />-->
  377. </Trigger>
  378. <Trigger Property="IsEnabled" Value="False">
  379. <Setter TargetName="state1" Property="Visibility" Value="Collapsed" />
  380. </Trigger>
  381. </ControlTemplate.Triggers>
  382. </ControlTemplate>
  383. </Setter.Value>
  384. </Setter>
  385. </Style>
  386. <Style x:Key="infoText4" TargetType="{x:Type ToggleButton}">
  387. <Setter Property="Background" Value="{StaticResource color.btn.sec.bg.norm}" />
  388. <Setter Property="Foreground" Value="{StaticResource color.btn.sec.text.def}" />
  389. <Setter Property="BorderBrush" Value="{StaticResource color.btn.sec.border-color}" />
  390. <Setter Property="BorderThickness" Value="0" />
  391. <Setter Property="Template">
  392. <Setter.Value>
  393. <ControlTemplate TargetType="{x:Type ToggleButton}">
  394. <Border
  395. x:Name="border"
  396. Background="{TemplateBinding Panel.Background}"
  397. BorderBrush="{TemplateBinding Border.BorderBrush}"
  398. BorderThickness="{TemplateBinding Border.BorderThickness}"
  399. CornerRadius="{StaticResource border-radius.4}"
  400. SnapsToDevicePixels="True">
  401. <Grid
  402. x:Name="grid"
  403. HorizontalAlignment="Center"
  404. VerticalAlignment="Center"
  405. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
  406. <StackPanel x:Name="state1" Visibility="Collapsed">
  407. <Rectangle
  408. Width="14"
  409. Height="1.5"
  410. HorizontalAlignment="Center"
  411. Fill="#252629" />
  412. <Rectangle
  413. Width="14"
  414. Height="1.5"
  415. Margin="0,2.5"
  416. HorizontalAlignment="Center"
  417. Fill="#252629" />
  418. <Rectangle
  419. Width="14"
  420. Height="1.5"
  421. Margin="0,0,0,2.5"
  422. HorizontalAlignment="Center"
  423. Fill="#252629" />
  424. <Rectangle
  425. Width="14"
  426. Height="1.5"
  427. HorizontalAlignment="Center"
  428. Fill="#252629" />
  429. </StackPanel>
  430. <StackPanel
  431. x:Name="state2"
  432. HorizontalAlignment="Center"
  433. VerticalAlignment="Center">
  434. <Rectangle
  435. Width="14"
  436. Height="1.5"
  437. HorizontalAlignment="Center"
  438. Fill="#616469" />
  439. <Rectangle
  440. Width="14"
  441. Height="1.5"
  442. Margin="0,2.5"
  443. HorizontalAlignment="Center"
  444. Fill="#616469" />
  445. <Rectangle
  446. Width="14"
  447. Height="1.5"
  448. Margin="0,0,0,2.5"
  449. HorizontalAlignment="Center"
  450. Fill="#616469" />
  451. <Rectangle
  452. Width="14"
  453. Height="1.5"
  454. HorizontalAlignment="Center"
  455. Fill="#616469" />
  456. </StackPanel>
  457. </Grid>
  458. </Border>
  459. <ControlTemplate.Triggers>
  460. <Trigger Property="IsMouseOver" Value="True">
  461. <Setter TargetName="state2" Property="Visibility" Value="Visible" />
  462. <Setter TargetName="state1" Property="Visibility" Value="Collapsed" />
  463. <Setter TargetName="border" Property="Background" Value="#EDEEF0" />
  464. </Trigger>
  465. <Trigger Property="IsChecked" Value="True">
  466. <Setter TargetName="state1" Property="Visibility" Value="Visible" />
  467. <Setter TargetName="state2" Property="Visibility" Value="Collapsed" />
  468. <Setter TargetName="border" Property="Background" Value="#CED0D4" />
  469. <!--<Setter TargetName="border" Property="BorderBrush" Value="{StaticResource color.btn.sec.border-color}" />
  470. <Setter TargetName="border" Property="BorderThickness" Value="{StaticResource border-width.1}" />-->
  471. </Trigger>
  472. <Trigger Property="IsEnabled" Value="False">
  473. <Setter TargetName="state1" Property="Visibility" Value="Collapsed" />
  474. </Trigger>
  475. </ControlTemplate.Triggers>
  476. </ControlTemplate>
  477. </Setter.Value>
  478. </Setter>
  479. </Style>
  480. </ResourceDictionary>