TabControlStyle.xaml 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774
  1. <ResourceDictionary
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:cus="clr-namespace:PDF_Office.CustomControl">
  5. <Style x:Key="TabControlWithUnderLineStyle" TargetType="{x:Type TabControl}">
  6. <Setter Property="Padding" Value="2" />
  7. <Setter Property="HorizontalContentAlignment" Value="Center" />
  8. <Setter Property="VerticalContentAlignment" Value="Center" />
  9. <Setter Property="Background" Value="Transparent" />
  10. <Setter Property="BorderBrush" Value="#FFACACAC" />
  11. <Setter Property="BorderThickness" Value="0,0,0,1" />
  12. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  13. <Setter Property="Template">
  14. <Setter.Value>
  15. <ControlTemplate TargetType="{x:Type TabControl}">
  16. <Grid
  17. x:Name="templateRoot"
  18. ClipToBounds="True"
  19. KeyboardNavigation.TabNavigation="Local"
  20. SnapsToDevicePixels="True">
  21. <Grid.ColumnDefinitions>
  22. <ColumnDefinition x:Name="ColumnDefinition0" />
  23. <ColumnDefinition x:Name="ColumnDefinition1" Width="0" />
  24. </Grid.ColumnDefinitions>
  25. <Grid.RowDefinitions>
  26. <RowDefinition x:Name="RowDefinition0" Height="Auto" />
  27. <RowDefinition x:Name="RowDefinition1" Height="*" />
  28. </Grid.RowDefinitions>
  29. <!-- 加滑轨配合滑轨样式可实现箭头左右滚动的菜单栏 -->
  30. <!--<ScrollViewer Margin="140 0 140 0" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Disabled">-->
  31. <TabPanel
  32. x:Name="HeaderPanel"
  33. Grid.Row="0"
  34. Grid.Column="0"
  35. HorizontalAlignment="{TemplateBinding HorizontalAlignment}"
  36. VerticalAlignment="{TemplateBinding VerticalAlignment}"
  37. Panel.ZIndex="1"
  38. Background="Transparent"
  39. IsItemsHost="True"
  40. KeyboardNavigation.TabIndex="1" />
  41. <!--</ScrollViewer>-->
  42. <!-- 页头和中间内容的分割线 -->
  43. <Line
  44. Margin="0,0,0,1"
  45. VerticalAlignment="Bottom"
  46. SnapsToDevicePixels="True"
  47. Stroke="#E7E9EC"
  48. StrokeThickness="0"
  49. X1="0"
  50. X2="{Binding ActualWidth, RelativeSource={RelativeSource Self}}" />
  51. <Border
  52. x:Name="ContentPanel"
  53. Grid.Row="1"
  54. Grid.Column="0"
  55. Background="{TemplateBinding Background}"
  56. BorderBrush="{TemplateBinding BorderBrush}"
  57. BorderThickness="{TemplateBinding BorderThickness}"
  58. KeyboardNavigation.DirectionalNavigation="Contained"
  59. KeyboardNavigation.TabIndex="2"
  60. KeyboardNavigation.TabNavigation="Local">
  61. <ContentPresenter
  62. x:Name="PART_SelectedContentHost"
  63. Margin="0"
  64. VerticalAlignment="Stretch"
  65. Content="{TemplateBinding SelectedContent}"
  66. ContentSource="SelectedContent"
  67. ContentStringFormat="{TemplateBinding SelectedContentStringFormat}"
  68. ContentTemplate="{TemplateBinding SelectedContentTemplate}"
  69. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  70. </Border>
  71. </Grid>
  72. <ControlTemplate.Triggers>
  73. <Trigger Property="TabStripPlacement" Value="Bottom">
  74. <Setter TargetName="HeaderPanel" Property="Grid.Row" Value="1" />
  75. <Setter TargetName="ContentPanel" Property="Grid.Row" Value="0" />
  76. <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
  77. <Setter TargetName="RowDefinition1" Property="Height" Value="Auto" />
  78. </Trigger>
  79. <Trigger Property="TabStripPlacement" Value="Left">
  80. <Setter TargetName="HeaderPanel" Property="Grid.Row" Value="0" />
  81. <Setter TargetName="ContentPanel" Property="Grid.Row" Value="0" />
  82. <Setter TargetName="HeaderPanel" Property="Grid.Column" Value="0" />
  83. <Setter TargetName="ContentPanel" Property="Grid.Column" Value="1" />
  84. <Setter TargetName="ColumnDefinition0" Property="Width" Value="Auto" />
  85. <Setter TargetName="ColumnDefinition1" Property="Width" Value="*" />
  86. <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
  87. <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
  88. <Setter TargetName="HeaderPanel" Property="VerticalAlignment" Value="Top" />
  89. </Trigger>
  90. <Trigger Property="TabStripPlacement" Value="Right">
  91. <Setter TargetName="HeaderPanel" Property="Grid.Row" Value="0" />
  92. <Setter TargetName="ContentPanel" Property="Grid.Row" Value="0" />
  93. <Setter TargetName="HeaderPanel" Property="Grid.Column" Value="1" />
  94. <Setter TargetName="ContentPanel" Property="Grid.Column" Value="0" />
  95. <Setter TargetName="ColumnDefinition0" Property="Width" Value="*" />
  96. <Setter TargetName="ColumnDefinition1" Property="Width" Value="Auto" />
  97. <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
  98. <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
  99. </Trigger>
  100. <Trigger Property="IsEnabled" Value="False">
  101. <Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  102. </Trigger>
  103. </ControlTemplate.Triggers>
  104. </ControlTemplate>
  105. </Setter.Value>
  106. </Setter>
  107. <Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Cycle" />
  108. <Setter Property="KeyboardNavigation.TabNavigation" Value="Cycle" />
  109. </Style>
  110. <!-- Design Token -->
  111. <Style x:Key="ToolbarTabs" TargetType="{x:Type cus:IconAndTextTabItem}">
  112. <Setter Property="Foreground" Value="{StaticResource color.sys.text.neutral.lv2}" />
  113. <Setter Property="Background" Value="White" />
  114. <Setter Property="BorderBrush" Value="#FFACACAC" />
  115. <Setter Property="HorizontalContentAlignment" Value="Stretch" />
  116. <Setter Property="VerticalContentAlignment" Value="Stretch" />
  117. <Setter Property="AllowDrop" Value="True" />
  118. <Setter Property="SelectedForeground" Value="{StaticResource color.sys.text.neutral.lv1}" />
  119. <Setter Property="FontSize" Value="14" />
  120. <Setter Property="Height" Value="40" />
  121. <Setter Property="Template">
  122. <Setter.Value>
  123. <ControlTemplate TargetType="{x:Type cus:IconAndTextTabItem}">
  124. <Grid
  125. x:Name="templateRoot"
  126. Margin="{TemplateBinding Padding}"
  127. Background="Transparent"
  128. SnapsToDevicePixels="True">
  129. <Border
  130. x:Name="_underline"
  131. Height="3"
  132. Margin="9,0"
  133. HorizontalAlignment="Stretch"
  134. VerticalAlignment="Bottom"
  135. Background="{StaticResource color.sys.layout.accent}"
  136. CornerRadius="2"
  137. Visibility="Collapsed" />
  138. <StackPanel Orientation="Horizontal">
  139. <Path
  140. x:Name="NormalPathIcon"
  141. MaxWidth="20"
  142. MaxHeight="20"
  143. Margin="0,0,4,0"
  144. Data="{Binding NormalPathIcon, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  145. Fill="Black"
  146. Visibility="Visible" />
  147. <Path
  148. x:Name="SelectedIcon"
  149. MaxWidth="20"
  150. MaxHeight=" 20"
  151. Margin="0,0,4,0"
  152. Data="{Binding SelectedIcon, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  153. Visibility="Collapsed" />
  154. <TextBlock
  155. x:Name="txt"
  156. Margin="0,0,4,0"
  157. HorizontalAlignment="Center"
  158. VerticalAlignment="Center"
  159. Foreground="{TemplateBinding Foreground}"
  160. Text="{TemplateBinding Header}"
  161. TextTrimming="CharacterEllipsis"
  162. ToolTip="{TemplateBinding Header}"
  163. Visibility="Visible" />
  164. </StackPanel>
  165. </Grid>
  166. <ControlTemplate.Triggers>
  167. <MultiDataTrigger>
  168. <MultiDataTrigger.Conditions>
  169. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
  170. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
  171. </MultiDataTrigger.Conditions>
  172. <Setter TargetName="SelectedIcon" Property="Visibility" Value="Collapsed" />
  173. <Setter TargetName="NormalPathIcon" Property="Visibility" Value="Visible" />
  174. <Setter TargetName="txt" Property="Foreground" Value="#FF000000" />
  175. </MultiDataTrigger>
  176. <MultiDataTrigger>
  177. <MultiDataTrigger.Conditions>
  178. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
  179. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Left" />
  180. </MultiDataTrigger.Conditions>
  181. <Setter TargetName="templateRoot" Property="Opacity" Value="0.56" />
  182. </MultiDataTrigger>
  183. <MultiDataTrigger>
  184. <MultiDataTrigger.Conditions>
  185. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
  186. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Bottom" />
  187. </MultiDataTrigger.Conditions>
  188. <Setter TargetName="templateRoot" Property="Opacity" Value="0.56" />
  189. </MultiDataTrigger>
  190. <MultiDataTrigger>
  191. <MultiDataTrigger.Conditions>
  192. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
  193. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Right" />
  194. </MultiDataTrigger.Conditions>
  195. <Setter TargetName="templateRoot" Property="Opacity" Value="0.56" />
  196. </MultiDataTrigger>
  197. <MultiDataTrigger>
  198. <MultiDataTrigger.Conditions>
  199. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
  200. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
  201. </MultiDataTrigger.Conditions>
  202. <Setter TargetName="templateRoot" Property="Opacity" Value="0.56" />
  203. </MultiDataTrigger>
  204. <MultiDataTrigger>
  205. <MultiDataTrigger.Conditions>
  206. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
  207. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
  208. </MultiDataTrigger.Conditions>
  209. <Setter TargetName="NormalPathIcon" Property="Opacity" Value="0.56" />
  210. </MultiDataTrigger>
  211. <MultiDataTrigger>
  212. <MultiDataTrigger.Conditions>
  213. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
  214. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
  215. </MultiDataTrigger.Conditions>
  216. <Setter Property="Panel.ZIndex" Value="1" />
  217. <Setter TargetName="txt" Property="Foreground" Value="{Binding SelectedForeground, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
  218. <Setter TargetName="_underline" Property="Visibility" Value="Visible" />
  219. <Setter TargetName="SelectedIcon" Property="Visibility" Value="Collapsed" />
  220. <Setter TargetName="NormalPathIcon" Property="Visibility" Value="Visible" />
  221. </MultiDataTrigger>
  222. </ControlTemplate.Triggers>
  223. </ControlTemplate>
  224. </Setter.Value>
  225. </Setter>
  226. </Style>
  227. <Style x:Key="BOTATab" TargetType="{x:Type cus:IconAndTextTabItem}">
  228. <Setter Property="Foreground" Value="{StaticResource color.icon.base.neutral.norm.lv1}" />
  229. <Setter Property="Background" Value="Transparent" />
  230. <Setter Property="BorderBrush" Value="#FFACACAC" />
  231. <Setter Property="BorderThickness" Value="0" />
  232. <Setter Property="HorizontalContentAlignment" Value="Stretch" />
  233. <Setter Property="VerticalContentAlignment" Value="Stretch" />
  234. <Setter Property="SelectedForeground" Value="{StaticResource color.icon.base.brand}" />
  235. <Setter Property="FontSize" Value="14" />
  236. <Setter Property="Height" Value="40" />
  237. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  238. <Setter Property="Padding" Value="0" />
  239. <Setter Property="Template">
  240. <Setter.Value>
  241. <ControlTemplate TargetType="{x:Type cus:IconAndTextTabItem}">
  242. <Grid
  243. x:Name="templateRoot"
  244. Margin="{TemplateBinding Padding}"
  245. Background="{TemplateBinding Background}"
  246. SnapsToDevicePixels="True">
  247. <Border
  248. x:Name="_underline"
  249. Height="3"
  250. Margin="9,0"
  251. HorizontalAlignment="Stretch"
  252. VerticalAlignment="Bottom"
  253. Background="{StaticResource color.sys.layout.accent}"
  254. CornerRadius="2"
  255. Visibility="Collapsed" />
  256. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
  257. <Path
  258. x:Name="NormalPathIcon"
  259. Width="20"
  260. Height="20"
  261. HorizontalAlignment="Center"
  262. VerticalAlignment="Center"
  263. Data="{Binding NormalPathIcon, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  264. Fill="{TemplateBinding Foreground}"
  265. Visibility="Visible" />
  266. <Path
  267. x:Name="SelectedIcon"
  268. Width="20"
  269. Height="20"
  270. HorizontalAlignment="Center"
  271. VerticalAlignment="Center"
  272. Data="{Binding SelectedIcon, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  273. Fill="{TemplateBinding SelectedForeground}"
  274. Visibility="Collapsed" />
  275. <TextBlock
  276. x:Name="txt"
  277. HorizontalAlignment="Center"
  278. VerticalAlignment="Center"
  279. Foreground="{TemplateBinding Foreground}"
  280. Text="{TemplateBinding Header}"
  281. TextTrimming="CharacterEllipsis"
  282. ToolTip="{TemplateBinding Header}"
  283. Visibility="Collapsed" />
  284. </StackPanel>
  285. </Grid>
  286. <ControlTemplate.Triggers>
  287. <Trigger Property="IsSelected" Value="True">
  288. <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
  289. <Setter TargetName="NormalPathIcon" Property="Visibility" Value="Collapsed" />
  290. <Setter TargetName="SelectedIcon" Property="Visibility" Value="Visible" />
  291. </Trigger>
  292. </ControlTemplate.Triggers>
  293. </ControlTemplate>
  294. </Setter.Value>
  295. </Setter>
  296. </Style>
  297. <!-- Design Token TabItem ControlTemplate for Forms Property Title -->
  298. <ControlTemplate x:Key="Segmented" TargetType="{x:Type TabItem}">
  299. <Grid x:Name="templateRoot" SnapsToDevicePixels="True">
  300. <Border
  301. x:Name="mainBorder"
  302. Margin="0"
  303. Background="{TemplateBinding Background}"
  304. BorderBrush="{TemplateBinding BorderBrush}"
  305. BorderThickness="0">
  306. <Border
  307. x:Name="innerBorder"
  308. Height="28"
  309. Margin="-1"
  310. Background="White"
  311. BorderBrush="#FFACACAC"
  312. BorderThickness="0"
  313. CornerRadius="4"
  314. Opacity="0" />
  315. </Border>
  316. <ContentPresenter
  317. x:Name="contentPresenter"
  318. Margin="{TemplateBinding Padding}"
  319. HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"
  320. VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"
  321. Content="{TemplateBinding Header}"
  322. ContentSource="Header"
  323. ContentStringFormat="{TemplateBinding HeaderStringFormat}"
  324. ContentTemplate="{TemplateBinding HeaderTemplate}"
  325. Focusable="False"
  326. RecognizesAccessKey="True"
  327. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  328. </Grid>
  329. <ControlTemplate.Triggers>
  330. <MultiDataTrigger>
  331. <MultiDataTrigger.Conditions>
  332. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
  333. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Left" />
  334. </MultiDataTrigger.Conditions>
  335. <Setter TargetName="mainBorder" Property="Background">
  336. <Setter.Value>
  337. <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
  338. <GradientStop Offset="0" Color="#FFECF4FC" />
  339. <GradientStop Offset="1" Color="#FFDCECFC" />
  340. </LinearGradientBrush>
  341. </Setter.Value>
  342. </Setter>
  343. <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FF7EB4EA" />
  344. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,0,1" />
  345. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,0,1" />
  346. </MultiDataTrigger>
  347. <MultiDataTrigger>
  348. <MultiDataTrigger.Conditions>
  349. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
  350. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Bottom" />
  351. </MultiDataTrigger.Conditions>
  352. <Setter TargetName="mainBorder" Property="Background">
  353. <Setter.Value>
  354. <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
  355. <GradientStop Offset="0" Color="#FFECF4FC" />
  356. <GradientStop Offset="1" Color="#FFDCECFC" />
  357. </LinearGradientBrush>
  358. </Setter.Value>
  359. </Setter>
  360. <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FF7EB4EA" />
  361. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,0,1,1" />
  362. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,0,1,1" />
  363. </MultiDataTrigger>
  364. <MultiDataTrigger>
  365. <MultiDataTrigger.Conditions>
  366. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
  367. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Right" />
  368. </MultiDataTrigger.Conditions>
  369. <Setter TargetName="mainBorder" Property="Background">
  370. <Setter.Value>
  371. <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
  372. <GradientStop Offset="0" Color="#FFECF4FC" />
  373. <GradientStop Offset="1" Color="#FFDCECFC" />
  374. </LinearGradientBrush>
  375. </Setter.Value>
  376. </Setter>
  377. <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FF7EB4EA" />
  378. <Setter TargetName="innerBorder" Property="BorderThickness" Value="0,1,1,1" />
  379. <Setter TargetName="mainBorder" Property="BorderThickness" Value="0,1,1,1" />
  380. </MultiDataTrigger>
  381. <MultiDataTrigger>
  382. <MultiDataTrigger.Conditions>
  383. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
  384. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
  385. </MultiDataTrigger.Conditions>
  386. <Setter TargetName="mainBorder" Property="Background">
  387. <Setter.Value>
  388. <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
  389. <GradientStop Offset="0" Color="#FFECF4FC" />
  390. <GradientStop Offset="1" Color="#FFDCECFC" />
  391. </LinearGradientBrush>
  392. </Setter.Value>
  393. </Setter>
  394. <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FF7EB4EA" />
  395. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,1,0" />
  396. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,1,0" />
  397. </MultiDataTrigger>
  398. <MultiDataTrigger>
  399. <MultiDataTrigger.Conditions>
  400. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
  401. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Left" />
  402. </MultiDataTrigger.Conditions>
  403. <Setter TargetName="contentPresenter" Property="Opacity" Value="0.56" />
  404. <Setter TargetName="mainBorder" Property="Background" Value="#FFF0F0F0" />
  405. <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FFD9D9D9" />
  406. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,0,1" />
  407. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,0,1" />
  408. </MultiDataTrigger>
  409. <MultiDataTrigger>
  410. <MultiDataTrigger.Conditions>
  411. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
  412. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Bottom" />
  413. </MultiDataTrigger.Conditions>
  414. <Setter TargetName="contentPresenter" Property="Opacity" Value="0.56" />
  415. <Setter TargetName="mainBorder" Property="Background" Value="#FFF0F0F0" />
  416. <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FFD9D9D9" />
  417. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,0,1,1" />
  418. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,0,1,1" />
  419. </MultiDataTrigger>
  420. <MultiDataTrigger>
  421. <MultiDataTrigger.Conditions>
  422. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
  423. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Right" />
  424. </MultiDataTrigger.Conditions>
  425. <Setter TargetName="contentPresenter" Property="Opacity" Value="0.56" />
  426. <Setter TargetName="mainBorder" Property="Background" Value="#FFF0F0F0" />
  427. <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FFD9D9D9" />
  428. <Setter TargetName="innerBorder" Property="BorderThickness" Value="0,1,1,1" />
  429. <Setter TargetName="mainBorder" Property="BorderThickness" Value="0,1,1,1" />
  430. </MultiDataTrigger>
  431. <MultiDataTrigger>
  432. <MultiDataTrigger.Conditions>
  433. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
  434. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
  435. </MultiDataTrigger.Conditions>
  436. <Setter TargetName="contentPresenter" Property="Opacity" Value="0.56" />
  437. <Setter TargetName="mainBorder" Property="Background" Value="#FFF0F0F0" />
  438. <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FFD9D9D9" />
  439. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,1,0" />
  440. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,1,0" />
  441. </MultiDataTrigger>
  442. <MultiDataTrigger>
  443. <MultiDataTrigger.Conditions>
  444. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
  445. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Left" />
  446. </MultiDataTrigger.Conditions>
  447. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,0,1" />
  448. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,0,1" />
  449. </MultiDataTrigger>
  450. <MultiDataTrigger>
  451. <MultiDataTrigger.Conditions>
  452. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
  453. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Left" />
  454. </MultiDataTrigger.Conditions>
  455. <Setter Property="Panel.ZIndex" Value="1" />
  456. <Setter Property="Margin" Value="-2,-2,0,-2" />
  457. <Setter TargetName="innerBorder" Property="Opacity" Value="1" />
  458. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,0,1" />
  459. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,0,1" />
  460. </MultiDataTrigger>
  461. <MultiDataTrigger>
  462. <MultiDataTrigger.Conditions>
  463. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
  464. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Bottom" />
  465. </MultiDataTrigger.Conditions>
  466. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,0,1,1" />
  467. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,0,1,1" />
  468. </MultiDataTrigger>
  469. <MultiDataTrigger>
  470. <MultiDataTrigger.Conditions>
  471. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
  472. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Bottom" />
  473. </MultiDataTrigger.Conditions>
  474. <Setter Property="Panel.ZIndex" Value="1" />
  475. <Setter Property="Margin" Value="-2,0,-2,-2" />
  476. <Setter TargetName="innerBorder" Property="Opacity" Value="1" />
  477. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,0,1,1" />
  478. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,0,1,1" />
  479. </MultiDataTrigger>
  480. <MultiDataTrigger>
  481. <MultiDataTrigger.Conditions>
  482. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
  483. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Right" />
  484. </MultiDataTrigger.Conditions>
  485. <Setter TargetName="innerBorder" Property="BorderThickness" Value="0,1,1,1" />
  486. <Setter TargetName="mainBorder" Property="BorderThickness" Value="0,1,1,1" />
  487. </MultiDataTrigger>
  488. <MultiDataTrigger>
  489. <MultiDataTrigger.Conditions>
  490. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
  491. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Right" />
  492. </MultiDataTrigger.Conditions>
  493. <Setter Property="Panel.ZIndex" Value="1" />
  494. <Setter Property="Margin" Value="0,-2,-2,-2" />
  495. <Setter TargetName="innerBorder" Property="Opacity" Value="1" />
  496. <Setter TargetName="innerBorder" Property="BorderThickness" Value="0,1,1,1" />
  497. <Setter TargetName="mainBorder" Property="BorderThickness" Value="0,1,1,1" />
  498. </MultiDataTrigger>
  499. <MultiDataTrigger>
  500. <MultiDataTrigger.Conditions>
  501. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
  502. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
  503. </MultiDataTrigger.Conditions>
  504. <Setter TargetName="innerBorder" Property="BorderThickness" Value="0" />
  505. <Setter TargetName="mainBorder" Property="BorderThickness" Value="0" />
  506. <Setter TargetName="mainBorder" Property="Background" Value="Transparent" />
  507. </MultiDataTrigger>
  508. <MultiDataTrigger>
  509. <MultiDataTrigger.Conditions>
  510. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
  511. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
  512. </MultiDataTrigger.Conditions>
  513. <Setter Property="Panel.ZIndex" Value="1" />
  514. <Setter Property="Margin" Value="0" />
  515. <Setter TargetName="innerBorder" Property="Opacity" Value="1" />
  516. <Setter TargetName="innerBorder" Property="BorderThickness" Value="0" />
  517. <Setter TargetName="mainBorder" Property="BorderThickness" Value="0" />
  518. <Setter TargetName="mainBorder" Property="Background" Value="Transparent" />
  519. </MultiDataTrigger>
  520. </ControlTemplate.Triggers>
  521. </ControlTemplate>
  522. <!-- design token TabHeader for Forms Property -->
  523. <Style x:Key="FormTabControl" TargetType="{x:Type TabControl}">
  524. <Setter Property="Padding" Value="2" />
  525. <Setter Property="HorizontalContentAlignment" Value="Center" />
  526. <Setter Property="VerticalContentAlignment" Value="Center" />
  527. <Setter Property="BorderThickness" Value="1" />
  528. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  529. <Setter Property="Template">
  530. <Setter.Value>
  531. <ControlTemplate TargetType="{x:Type TabControl}">
  532. <Grid
  533. x:Name="templateRoot"
  534. ClipToBounds="true"
  535. KeyboardNavigation.TabNavigation="Local"
  536. SnapsToDevicePixels="true">
  537. <Grid.ColumnDefinitions>
  538. <ColumnDefinition x:Name="ColumnDefinition0" />
  539. <ColumnDefinition x:Name="ColumnDefinition1" Width="0" />
  540. </Grid.ColumnDefinitions>
  541. <Grid.RowDefinitions>
  542. <RowDefinition x:Name="RowDefinition0" Height="Auto" />
  543. <RowDefinition x:Name="RowDefinition1" Height="*" />
  544. </Grid.RowDefinitions>
  545. <Border
  546. Grid.Row="0"
  547. Grid.Column="0"
  548. HorizontalAlignment="Center"
  549. Background="{StaticResource color.sys.layout.fg.dark}"
  550. CornerRadius="4">
  551. <TabPanel
  552. x:Name="headerPanel"
  553. Margin="2"
  554. HorizontalAlignment="Center"
  555. VerticalAlignment="Center"
  556. Panel.ZIndex="1"
  557. Background="Transparent"
  558. IsItemsHost="true"
  559. KeyboardNavigation.TabIndex="1" />
  560. </Border>
  561. <Border
  562. x:Name="contentPanel"
  563. Grid.Row="1"
  564. Grid.Column="0"
  565. Background="{TemplateBinding Background}"
  566. BorderBrush="{TemplateBinding BorderBrush}"
  567. BorderThickness="{TemplateBinding BorderThickness}"
  568. KeyboardNavigation.DirectionalNavigation="Contained"
  569. KeyboardNavigation.TabIndex="2"
  570. KeyboardNavigation.TabNavigation="Local">
  571. <ContentPresenter
  572. x:Name="PART_SelectedContentHost"
  573. Margin="{TemplateBinding Padding}"
  574. ContentSource="SelectedContent"
  575. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  576. </Border>
  577. </Grid>
  578. <ControlTemplate.Triggers>
  579. <Trigger Property="TabStripPlacement" Value="Bottom">
  580. <Setter TargetName="headerPanel" Property="Grid.Row" Value="1" />
  581. <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
  582. <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
  583. <Setter TargetName="RowDefinition1" Property="Height" Value="Auto" />
  584. <Setter TargetName="headerPanel" Property="Margin" Value="2,0,2,2" />
  585. </Trigger>
  586. <Trigger Property="TabStripPlacement" Value="Left">
  587. <Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
  588. <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
  589. <Setter TargetName="headerPanel" Property="Grid.Column" Value="0" />
  590. <Setter TargetName="contentPanel" Property="Grid.Column" Value="1" />
  591. <Setter TargetName="ColumnDefinition0" Property="Width" Value="Auto" />
  592. <Setter TargetName="ColumnDefinition1" Property="Width" Value="*" />
  593. <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
  594. <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
  595. <Setter TargetName="headerPanel" Property="Margin" Value="2,2,0,2" />
  596. </Trigger>
  597. <Trigger Property="TabStripPlacement" Value="Right">
  598. <Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
  599. <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
  600. <Setter TargetName="headerPanel" Property="Grid.Column" Value="1" />
  601. <Setter TargetName="contentPanel" Property="Grid.Column" Value="0" />
  602. <Setter TargetName="ColumnDefinition0" Property="Width" Value="*" />
  603. <Setter TargetName="ColumnDefinition1" Property="Width" Value="Auto" />
  604. <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
  605. <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
  606. <Setter TargetName="headerPanel" Property="Margin" Value="0,2,2,2" />
  607. </Trigger>
  608. <Trigger Property="IsEnabled" Value="false">
  609. <Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  610. </Trigger>
  611. </ControlTemplate.Triggers>
  612. </ControlTemplate>
  613. </Setter.Value>
  614. </Setter>
  615. </Style>
  616. <Style x:Key="InfoTabControl" TargetType="{x:Type TabControl}">
  617. <Setter Property="Padding" Value="8" />
  618. <Setter Property="HorizontalContentAlignment" Value="Left" />
  619. <Setter Property="VerticalContentAlignment" Value="Center" />
  620. <Setter Property="BorderThickness" Value="0" />
  621. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  622. <Setter Property="Template">
  623. <Setter.Value>
  624. <ControlTemplate TargetType="{x:Type TabControl}">
  625. <Grid
  626. x:Name="templateRoot"
  627. ClipToBounds="true"
  628. KeyboardNavigation.TabNavigation="Local"
  629. SnapsToDevicePixels="true">
  630. <Grid.ColumnDefinitions>
  631. <ColumnDefinition x:Name="ColumnDefinition0" Width="200" />
  632. <ColumnDefinition x:Name="ColumnDefinition1" Width="500" />
  633. </Grid.ColumnDefinitions>
  634. <Border
  635. Grid.Column="0"
  636. Width="200"
  637. HorizontalAlignment="Stretch"
  638. VerticalAlignment="Stretch"
  639. Background="{StaticResource color.sys.layout.mg}"
  640. BorderThickness="1"
  641. CornerRadius="4">
  642. <TabPanel
  643. x:Name="headerPanel"
  644. Width="180"
  645. HorizontalAlignment="Center"
  646. VerticalAlignment="Stretch"
  647. Panel.ZIndex="1"
  648. Background="Transparent"
  649. IsItemsHost="true"
  650. KeyboardNavigation.TabIndex="1" />
  651. </Border>
  652. <Border
  653. x:Name="contentPanel"
  654. Grid.Column="1"
  655. Background="{TemplateBinding Background}"
  656. BorderBrush="{TemplateBinding BorderBrush}"
  657. BorderThickness="{TemplateBinding BorderThickness}"
  658. KeyboardNavigation.DirectionalNavigation="Contained"
  659. KeyboardNavigation.TabIndex="2"
  660. KeyboardNavigation.TabNavigation="Local">
  661. <ContentPresenter
  662. x:Name="PART_SelectedContentHost"
  663. Margin="{TemplateBinding Margin}"
  664. HorizontalAlignment="Right"
  665. VerticalAlignment="Center"
  666. ContentSource="SelectedContent"
  667. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  668. </Border>
  669. </Grid>
  670. <ControlTemplate.Triggers>
  671. <Trigger Property="TabStripPlacement" Value="Bottom">
  672. <Setter TargetName="headerPanel" Property="Grid.Row" Value="1" />
  673. <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
  674. <Setter TargetName="headerPanel" Property="Margin" Value="2,0,2,2" />
  675. </Trigger>
  676. <Trigger Property="TabStripPlacement" Value="Left">
  677. <Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
  678. <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
  679. <Setter TargetName="headerPanel" Property="Grid.Column" Value="0" />
  680. <Setter TargetName="contentPanel" Property="Grid.Column" Value="1" />
  681. <Setter TargetName="ColumnDefinition0" Property="Width" Value="Auto" />
  682. <Setter TargetName="ColumnDefinition1" Property="Width" Value="*" />
  683. <Setter TargetName="headerPanel" Property="Margin" Value="2,2,0,2" />
  684. </Trigger>
  685. <Trigger Property="TabStripPlacement" Value="Right">
  686. <Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
  687. <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
  688. <Setter TargetName="headerPanel" Property="Grid.Column" Value="1" />
  689. <Setter TargetName="contentPanel" Property="Grid.Column" Value="0" />
  690. <Setter TargetName="ColumnDefinition0" Property="Width" Value="*" />
  691. <Setter TargetName="ColumnDefinition1" Property="Width" Value="Auto" />
  692. <Setter TargetName="headerPanel" Property="Margin" Value="0,2,2,2" />
  693. </Trigger>
  694. <Trigger Property="IsEnabled" Value="false">
  695. <Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  696. </Trigger>
  697. </ControlTemplate.Triggers>
  698. </ControlTemplate>
  699. </Setter.Value>
  700. </Setter>
  701. </Style>
  702. <Style x:Key="InfoTabItem" TargetType="{x:Type TabItem}">
  703. <Setter Property="Height" Value="50" />
  704. <Setter Property="Width" Value="200" />
  705. <Setter Property="Template">
  706. <Setter.Value>
  707. <ControlTemplate TargetType="{x:Type TabItem}">
  708. <Grid>
  709. <Border
  710. Name="Border"
  711. Height="32"
  712. Padding="8,0"
  713. Background="Transparent"
  714. BorderBrush="Transparent"
  715. BorderThickness="1"
  716. CornerRadius="4">
  717. <ContentPresenter
  718. x:Name="ContentSite"
  719. HorizontalAlignment="Left"
  720. VerticalAlignment="Center"
  721. ContentSource="Header"
  722. RecognizesAccessKey="True" />
  723. </Border>
  724. </Grid>
  725. <ControlTemplate.Triggers>
  726. <Trigger Property="IsSelected" Value="True">
  727. <Setter Property="Panel.ZIndex" Value="100" />
  728. <Setter TargetName="Border" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv1}" />
  729. <Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" />
  730. </Trigger>
  731. <Trigger Property="IsSelected" Value="False">
  732. <Setter Property="Panel.ZIndex" Value="100" />
  733. <Setter TargetName="Border" Property="Background" Value="Transparent" />
  734. <Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" />
  735. </Trigger>
  736. </ControlTemplate.Triggers>
  737. </ControlTemplate>
  738. </Setter.Value>
  739. </Setter>
  740. </Style>
  741. <!--<Style x:Key="InfoTabItem" TargetType="{x:Type TabItem}">
  742. <Setter Property="HeaderTemplate">
  743. <Setter.Value>
  744. -->
  745. <!--<DataTemplate>
  746. <DataTemplate.Triggers>
  747. <Trigger Property="IsSelected" Value="True">
  748. <Setter TargetName="img" Property="Source" Value="images/customimage.png" />
  749. </Trigger>
  750. </DataTemplate.Triggers>
  751. </DataTemplate>-->
  752. <!--
  753. <ControlTemplate TargetType="{x:Type TabItem}">
  754. <ContentPresenter />
  755. <ControlTemplate.Triggers>
  756. <Trigger Property="IsSelected" Value="True">
  757. <Setter TargetName="img" Property="Source" Value="images/customimage.png" />
  758. </Trigger>
  759. </ControlTemplate.Triggers>
  760. </ControlTemplate>
  761. </Setter.Value>
  762. </Setter>
  763. </Style>-->
  764. </ResourceDictionary>