TabControlStyle.xaml 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777
  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_Master.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. FontFamily="Segoe UI"
  160. FontSize="14"
  161. Foreground="{TemplateBinding Foreground}"
  162. Text="{TemplateBinding Header}"
  163. TextTrimming="CharacterEllipsis"
  164. ToolTip="{TemplateBinding Header}"
  165. Visibility="Visible" />
  166. </StackPanel>
  167. </Grid>
  168. <ControlTemplate.Triggers>
  169. <MultiDataTrigger>
  170. <MultiDataTrigger.Conditions>
  171. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
  172. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
  173. </MultiDataTrigger.Conditions>
  174. <Setter TargetName="SelectedIcon" Property="Visibility" Value="Collapsed" />
  175. <Setter TargetName="NormalPathIcon" Property="Visibility" Value="Visible" />
  176. <Setter TargetName="txt" Property="Foreground" Value="#FF000000" />
  177. </MultiDataTrigger>
  178. <MultiDataTrigger>
  179. <MultiDataTrigger.Conditions>
  180. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
  181. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Left" />
  182. </MultiDataTrigger.Conditions>
  183. <Setter TargetName="templateRoot" Property="Opacity" Value="0.56" />
  184. </MultiDataTrigger>
  185. <MultiDataTrigger>
  186. <MultiDataTrigger.Conditions>
  187. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
  188. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Bottom" />
  189. </MultiDataTrigger.Conditions>
  190. <Setter TargetName="templateRoot" Property="Opacity" Value="0.56" />
  191. </MultiDataTrigger>
  192. <MultiDataTrigger>
  193. <MultiDataTrigger.Conditions>
  194. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
  195. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Right" />
  196. </MultiDataTrigger.Conditions>
  197. <Setter TargetName="templateRoot" Property="Opacity" Value="0.56" />
  198. </MultiDataTrigger>
  199. <MultiDataTrigger>
  200. <MultiDataTrigger.Conditions>
  201. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
  202. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
  203. </MultiDataTrigger.Conditions>
  204. <Setter TargetName="templateRoot" Property="Opacity" Value="0.56" />
  205. </MultiDataTrigger>
  206. <MultiDataTrigger>
  207. <MultiDataTrigger.Conditions>
  208. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
  209. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
  210. </MultiDataTrigger.Conditions>
  211. <Setter TargetName="NormalPathIcon" Property="Opacity" Value="0.56" />
  212. </MultiDataTrigger>
  213. <MultiDataTrigger>
  214. <MultiDataTrigger.Conditions>
  215. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
  216. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
  217. </MultiDataTrigger.Conditions>
  218. <Setter Property="Panel.ZIndex" Value="1" />
  219. <Setter TargetName="txt" Property="Foreground" Value="{Binding SelectedForeground, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
  220. <Setter TargetName="txt" Property="TextBlock.FontWeight" Value="SemiBold" />
  221. <Setter TargetName="_underline" Property="Visibility" Value="Visible" />
  222. <Setter TargetName="SelectedIcon" Property="Visibility" Value="Collapsed" />
  223. <Setter TargetName="NormalPathIcon" Property="Visibility" Value="Visible" />
  224. </MultiDataTrigger>
  225. </ControlTemplate.Triggers>
  226. </ControlTemplate>
  227. </Setter.Value>
  228. </Setter>
  229. </Style>
  230. <Style x:Key="BOTATab" TargetType="{x:Type cus:IconAndTextTabItem}">
  231. <Setter Property="Foreground" Value="{StaticResource color.icon.base.neutral.norm.lv1}" />
  232. <Setter Property="Background" Value="Transparent" />
  233. <Setter Property="BorderBrush" Value="#FFACACAC" />
  234. <Setter Property="BorderThickness" Value="0" />
  235. <Setter Property="HorizontalContentAlignment" Value="Stretch" />
  236. <Setter Property="VerticalContentAlignment" Value="Stretch" />
  237. <Setter Property="SelectedForeground" Value="{StaticResource color.icon.base.brand}" />
  238. <Setter Property="FontSize" Value="14" />
  239. <Setter Property="Height" Value="40" />
  240. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  241. <Setter Property="Padding" Value="0" />
  242. <Setter Property="Template">
  243. <Setter.Value>
  244. <ControlTemplate TargetType="{x:Type cus:IconAndTextTabItem}">
  245. <Grid
  246. x:Name="templateRoot"
  247. Margin="{TemplateBinding Padding}"
  248. Background="{TemplateBinding Background}"
  249. SnapsToDevicePixels="True">
  250. <Border
  251. x:Name="_underline"
  252. Height="3"
  253. Margin="9,0"
  254. HorizontalAlignment="Stretch"
  255. VerticalAlignment="Bottom"
  256. Background="{StaticResource color.sys.layout.accent}"
  257. CornerRadius="2"
  258. Visibility="Collapsed" />
  259. <StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
  260. <Path
  261. x:Name="NormalPathIcon"
  262. Width="20"
  263. Height="20"
  264. HorizontalAlignment="Center"
  265. VerticalAlignment="Center"
  266. Data="{Binding NormalPathIcon, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  267. Fill="{TemplateBinding Foreground}"
  268. Visibility="Visible" />
  269. <Path
  270. x:Name="SelectedIcon"
  271. Width="20"
  272. Height="20"
  273. HorizontalAlignment="Center"
  274. VerticalAlignment="Center"
  275. Data="{Binding SelectedIcon, RelativeSource={RelativeSource Mode=TemplatedParent}}"
  276. Fill="{TemplateBinding SelectedForeground}"
  277. Visibility="Collapsed" />
  278. <TextBlock
  279. x:Name="txt"
  280. HorizontalAlignment="Center"
  281. VerticalAlignment="Center"
  282. Foreground="{TemplateBinding Foreground}"
  283. Text="{TemplateBinding Header}"
  284. TextTrimming="CharacterEllipsis"
  285. ToolTip="{TemplateBinding Header}"
  286. Visibility="Collapsed" />
  287. </StackPanel>
  288. </Grid>
  289. <ControlTemplate.Triggers>
  290. <Trigger Property="IsSelected" Value="True">
  291. <Setter Property="Background" Value="{StaticResource color.item-state.sel.bg.lv2}" />
  292. <Setter TargetName="NormalPathIcon" Property="Visibility" Value="Collapsed" />
  293. <Setter TargetName="SelectedIcon" Property="Visibility" Value="Visible" />
  294. </Trigger>
  295. </ControlTemplate.Triggers>
  296. </ControlTemplate>
  297. </Setter.Value>
  298. </Setter>
  299. </Style>
  300. <!-- Design Token TabItem ControlTemplate for Forms Property Title -->
  301. <ControlTemplate x:Key="Segmented" TargetType="{x:Type TabItem}">
  302. <Grid x:Name="templateRoot" SnapsToDevicePixels="True">
  303. <Border
  304. x:Name="mainBorder"
  305. Margin="0"
  306. Background="{TemplateBinding Background}"
  307. BorderBrush="{TemplateBinding BorderBrush}"
  308. BorderThickness="0">
  309. <Border
  310. x:Name="innerBorder"
  311. Height="28"
  312. Margin="-1"
  313. Background="White"
  314. BorderBrush="#FFACACAC"
  315. BorderThickness="0"
  316. CornerRadius="4"
  317. Opacity="0" />
  318. </Border>
  319. <ContentPresenter
  320. x:Name="contentPresenter"
  321. Margin="{TemplateBinding Padding}"
  322. HorizontalAlignment="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"
  323. VerticalAlignment="{Binding VerticalContentAlignment, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type ItemsControl}}}"
  324. Content="{TemplateBinding Header}"
  325. ContentSource="Header"
  326. ContentStringFormat="{TemplateBinding HeaderStringFormat}"
  327. ContentTemplate="{TemplateBinding HeaderTemplate}"
  328. Focusable="False"
  329. RecognizesAccessKey="True"
  330. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  331. </Grid>
  332. <ControlTemplate.Triggers>
  333. <MultiDataTrigger>
  334. <MultiDataTrigger.Conditions>
  335. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
  336. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Left" />
  337. </MultiDataTrigger.Conditions>
  338. <Setter TargetName="mainBorder" Property="Background">
  339. <Setter.Value>
  340. <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
  341. <GradientStop Offset="0" Color="#FFECF4FC" />
  342. <GradientStop Offset="1" Color="#FFDCECFC" />
  343. </LinearGradientBrush>
  344. </Setter.Value>
  345. </Setter>
  346. <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FF7EB4EA" />
  347. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,0,1" />
  348. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,0,1" />
  349. </MultiDataTrigger>
  350. <MultiDataTrigger>
  351. <MultiDataTrigger.Conditions>
  352. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
  353. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Bottom" />
  354. </MultiDataTrigger.Conditions>
  355. <Setter TargetName="mainBorder" Property="Background">
  356. <Setter.Value>
  357. <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
  358. <GradientStop Offset="0" Color="#FFECF4FC" />
  359. <GradientStop Offset="1" Color="#FFDCECFC" />
  360. </LinearGradientBrush>
  361. </Setter.Value>
  362. </Setter>
  363. <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FF7EB4EA" />
  364. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,0,1,1" />
  365. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,0,1,1" />
  366. </MultiDataTrigger>
  367. <MultiDataTrigger>
  368. <MultiDataTrigger.Conditions>
  369. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
  370. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Right" />
  371. </MultiDataTrigger.Conditions>
  372. <Setter TargetName="mainBorder" Property="Background">
  373. <Setter.Value>
  374. <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
  375. <GradientStop Offset="0" Color="#FFECF4FC" />
  376. <GradientStop Offset="1" Color="#FFDCECFC" />
  377. </LinearGradientBrush>
  378. </Setter.Value>
  379. </Setter>
  380. <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FF7EB4EA" />
  381. <Setter TargetName="innerBorder" Property="BorderThickness" Value="0,1,1,1" />
  382. <Setter TargetName="mainBorder" Property="BorderThickness" Value="0,1,1,1" />
  383. </MultiDataTrigger>
  384. <MultiDataTrigger>
  385. <MultiDataTrigger.Conditions>
  386. <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true" />
  387. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
  388. </MultiDataTrigger.Conditions>
  389. <Setter TargetName="mainBorder" Property="Background">
  390. <Setter.Value>
  391. <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
  392. <GradientStop Offset="0" Color="#FFECF4FC" />
  393. <GradientStop Offset="1" Color="#FFDCECFC" />
  394. </LinearGradientBrush>
  395. </Setter.Value>
  396. </Setter>
  397. <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FF7EB4EA" />
  398. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,1,0" />
  399. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,1,0" />
  400. </MultiDataTrigger>
  401. <MultiDataTrigger>
  402. <MultiDataTrigger.Conditions>
  403. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
  404. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Left" />
  405. </MultiDataTrigger.Conditions>
  406. <Setter TargetName="contentPresenter" Property="Opacity" Value="0.56" />
  407. <Setter TargetName="mainBorder" Property="Background" Value="#FFF0F0F0" />
  408. <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FFD9D9D9" />
  409. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,0,1" />
  410. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,0,1" />
  411. </MultiDataTrigger>
  412. <MultiDataTrigger>
  413. <MultiDataTrigger.Conditions>
  414. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
  415. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Bottom" />
  416. </MultiDataTrigger.Conditions>
  417. <Setter TargetName="contentPresenter" Property="Opacity" Value="0.56" />
  418. <Setter TargetName="mainBorder" Property="Background" Value="#FFF0F0F0" />
  419. <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FFD9D9D9" />
  420. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,0,1,1" />
  421. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,0,1,1" />
  422. </MultiDataTrigger>
  423. <MultiDataTrigger>
  424. <MultiDataTrigger.Conditions>
  425. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
  426. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Right" />
  427. </MultiDataTrigger.Conditions>
  428. <Setter TargetName="contentPresenter" Property="Opacity" Value="0.56" />
  429. <Setter TargetName="mainBorder" Property="Background" Value="#FFF0F0F0" />
  430. <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FFD9D9D9" />
  431. <Setter TargetName="innerBorder" Property="BorderThickness" Value="0,1,1,1" />
  432. <Setter TargetName="mainBorder" Property="BorderThickness" Value="0,1,1,1" />
  433. </MultiDataTrigger>
  434. <MultiDataTrigger>
  435. <MultiDataTrigger.Conditions>
  436. <Condition Binding="{Binding IsEnabled, RelativeSource={RelativeSource Self}}" Value="false" />
  437. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
  438. </MultiDataTrigger.Conditions>
  439. <Setter TargetName="contentPresenter" Property="Opacity" Value="0.56" />
  440. <Setter TargetName="mainBorder" Property="Background" Value="#FFF0F0F0" />
  441. <Setter TargetName="mainBorder" Property="BorderBrush" Value="#FFD9D9D9" />
  442. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,1,0" />
  443. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,1,0" />
  444. </MultiDataTrigger>
  445. <MultiDataTrigger>
  446. <MultiDataTrigger.Conditions>
  447. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
  448. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Left" />
  449. </MultiDataTrigger.Conditions>
  450. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,0,1" />
  451. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,0,1" />
  452. </MultiDataTrigger>
  453. <MultiDataTrigger>
  454. <MultiDataTrigger.Conditions>
  455. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
  456. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Left" />
  457. </MultiDataTrigger.Conditions>
  458. <Setter Property="Panel.ZIndex" Value="1" />
  459. <Setter Property="Margin" Value="-2,-2,0,-2" />
  460. <Setter TargetName="innerBorder" Property="Opacity" Value="1" />
  461. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,1,0,1" />
  462. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,1,0,1" />
  463. </MultiDataTrigger>
  464. <MultiDataTrigger>
  465. <MultiDataTrigger.Conditions>
  466. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
  467. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Bottom" />
  468. </MultiDataTrigger.Conditions>
  469. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,0,1,1" />
  470. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,0,1,1" />
  471. </MultiDataTrigger>
  472. <MultiDataTrigger>
  473. <MultiDataTrigger.Conditions>
  474. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
  475. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Bottom" />
  476. </MultiDataTrigger.Conditions>
  477. <Setter Property="Panel.ZIndex" Value="1" />
  478. <Setter Property="Margin" Value="-2,0,-2,-2" />
  479. <Setter TargetName="innerBorder" Property="Opacity" Value="1" />
  480. <Setter TargetName="innerBorder" Property="BorderThickness" Value="1,0,1,1" />
  481. <Setter TargetName="mainBorder" Property="BorderThickness" Value="1,0,1,1" />
  482. </MultiDataTrigger>
  483. <MultiDataTrigger>
  484. <MultiDataTrigger.Conditions>
  485. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
  486. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Right" />
  487. </MultiDataTrigger.Conditions>
  488. <Setter TargetName="innerBorder" Property="BorderThickness" Value="0,1,1,1" />
  489. <Setter TargetName="mainBorder" Property="BorderThickness" Value="0,1,1,1" />
  490. </MultiDataTrigger>
  491. <MultiDataTrigger>
  492. <MultiDataTrigger.Conditions>
  493. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
  494. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Right" />
  495. </MultiDataTrigger.Conditions>
  496. <Setter Property="Panel.ZIndex" Value="1" />
  497. <Setter Property="Margin" Value="0,-2,-2,-2" />
  498. <Setter TargetName="innerBorder" Property="Opacity" Value="1" />
  499. <Setter TargetName="innerBorder" Property="BorderThickness" Value="0,1,1,1" />
  500. <Setter TargetName="mainBorder" Property="BorderThickness" Value="0,1,1,1" />
  501. </MultiDataTrigger>
  502. <MultiDataTrigger>
  503. <MultiDataTrigger.Conditions>
  504. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="false" />
  505. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
  506. </MultiDataTrigger.Conditions>
  507. <Setter TargetName="innerBorder" Property="BorderThickness" Value="0" />
  508. <Setter TargetName="mainBorder" Property="BorderThickness" Value="0" />
  509. <Setter TargetName="mainBorder" Property="Background" Value="Transparent" />
  510. </MultiDataTrigger>
  511. <MultiDataTrigger>
  512. <MultiDataTrigger.Conditions>
  513. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
  514. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type TabControl}}}" Value="Top" />
  515. </MultiDataTrigger.Conditions>
  516. <Setter Property="Panel.ZIndex" Value="1" />
  517. <Setter Property="Margin" Value="0" />
  518. <Setter TargetName="innerBorder" Property="Opacity" Value="1" />
  519. <Setter TargetName="innerBorder" Property="BorderThickness" Value="0" />
  520. <Setter TargetName="mainBorder" Property="BorderThickness" Value="0" />
  521. <Setter TargetName="mainBorder" Property="Background" Value="Transparent" />
  522. </MultiDataTrigger>
  523. </ControlTemplate.Triggers>
  524. </ControlTemplate>
  525. <!-- design token TabHeader for Forms Property -->
  526. <Style x:Key="FormTabControl" TargetType="{x:Type TabControl}">
  527. <Setter Property="Padding" Value="2" />
  528. <Setter Property="HorizontalContentAlignment" Value="Center" />
  529. <Setter Property="VerticalContentAlignment" Value="Center" />
  530. <Setter Property="BorderThickness" Value="1" />
  531. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  532. <Setter Property="Template">
  533. <Setter.Value>
  534. <ControlTemplate TargetType="{x:Type TabControl}">
  535. <Grid
  536. x:Name="templateRoot"
  537. ClipToBounds="true"
  538. KeyboardNavigation.TabNavigation="Local"
  539. SnapsToDevicePixels="true">
  540. <Grid.ColumnDefinitions>
  541. <ColumnDefinition x:Name="ColumnDefinition0" />
  542. <ColumnDefinition x:Name="ColumnDefinition1" Width="0" />
  543. </Grid.ColumnDefinitions>
  544. <Grid.RowDefinitions>
  545. <RowDefinition x:Name="RowDefinition0" Height="Auto" />
  546. <RowDefinition x:Name="RowDefinition1" Height="*" />
  547. </Grid.RowDefinitions>
  548. <Border
  549. Grid.Row="0"
  550. Grid.Column="0"
  551. HorizontalAlignment="Center"
  552. Background="{StaticResource color.sys.layout.fg.dark}"
  553. CornerRadius="4">
  554. <TabPanel
  555. x:Name="headerPanel"
  556. Margin="2"
  557. HorizontalAlignment="Center"
  558. VerticalAlignment="Center"
  559. Panel.ZIndex="1"
  560. Background="Transparent"
  561. IsItemsHost="true"
  562. KeyboardNavigation.TabIndex="1" />
  563. </Border>
  564. <Border
  565. x:Name="contentPanel"
  566. Grid.Row="1"
  567. Grid.Column="0"
  568. Background="{TemplateBinding Background}"
  569. BorderBrush="{TemplateBinding BorderBrush}"
  570. BorderThickness="{TemplateBinding BorderThickness}"
  571. KeyboardNavigation.DirectionalNavigation="Contained"
  572. KeyboardNavigation.TabIndex="2"
  573. KeyboardNavigation.TabNavigation="Local">
  574. <ContentPresenter
  575. x:Name="PART_SelectedContentHost"
  576. Margin="{TemplateBinding Padding}"
  577. ContentSource="SelectedContent"
  578. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  579. </Border>
  580. </Grid>
  581. <ControlTemplate.Triggers>
  582. <Trigger Property="TabStripPlacement" Value="Bottom">
  583. <Setter TargetName="headerPanel" Property="Grid.Row" Value="1" />
  584. <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
  585. <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
  586. <Setter TargetName="RowDefinition1" Property="Height" Value="Auto" />
  587. <Setter TargetName="headerPanel" Property="Margin" Value="2,0,2,2" />
  588. </Trigger>
  589. <Trigger Property="TabStripPlacement" Value="Left">
  590. <Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
  591. <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
  592. <Setter TargetName="headerPanel" Property="Grid.Column" Value="0" />
  593. <Setter TargetName="contentPanel" Property="Grid.Column" Value="1" />
  594. <Setter TargetName="ColumnDefinition0" Property="Width" Value="Auto" />
  595. <Setter TargetName="ColumnDefinition1" Property="Width" Value="*" />
  596. <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
  597. <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
  598. <Setter TargetName="headerPanel" Property="Margin" Value="2,2,0,2" />
  599. </Trigger>
  600. <Trigger Property="TabStripPlacement" Value="Right">
  601. <Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
  602. <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
  603. <Setter TargetName="headerPanel" Property="Grid.Column" Value="1" />
  604. <Setter TargetName="contentPanel" Property="Grid.Column" Value="0" />
  605. <Setter TargetName="ColumnDefinition0" Property="Width" Value="*" />
  606. <Setter TargetName="ColumnDefinition1" Property="Width" Value="Auto" />
  607. <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
  608. <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
  609. <Setter TargetName="headerPanel" Property="Margin" Value="0,2,2,2" />
  610. </Trigger>
  611. <Trigger Property="IsEnabled" Value="false">
  612. <Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  613. </Trigger>
  614. </ControlTemplate.Triggers>
  615. </ControlTemplate>
  616. </Setter.Value>
  617. </Setter>
  618. </Style>
  619. <Style x:Key="InfoTabControl" TargetType="{x:Type TabControl}">
  620. <Setter Property="Padding" Value="8" />
  621. <Setter Property="HorizontalContentAlignment" Value="Left" />
  622. <Setter Property="VerticalContentAlignment" Value="Center" />
  623. <Setter Property="BorderThickness" Value="0" />
  624. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
  625. <Setter Property="Template">
  626. <Setter.Value>
  627. <ControlTemplate TargetType="{x:Type TabControl}">
  628. <Grid
  629. x:Name="templateRoot"
  630. ClipToBounds="true"
  631. KeyboardNavigation.TabNavigation="Local"
  632. SnapsToDevicePixels="true">
  633. <Grid.ColumnDefinitions>
  634. <ColumnDefinition x:Name="ColumnDefinition0" Width="200" />
  635. <ColumnDefinition x:Name="ColumnDefinition1" Width="500" />
  636. </Grid.ColumnDefinitions>
  637. <Border
  638. Grid.Column="0"
  639. Width="200"
  640. HorizontalAlignment="Stretch"
  641. VerticalAlignment="Stretch"
  642. Background="{StaticResource color.sys.layout.mg}"
  643. BorderThickness="1"
  644. CornerRadius="4">
  645. <TabPanel
  646. x:Name="headerPanel"
  647. Width="180"
  648. HorizontalAlignment="Center"
  649. VerticalAlignment="Stretch"
  650. Panel.ZIndex="1"
  651. Background="Transparent"
  652. IsItemsHost="true"
  653. KeyboardNavigation.TabIndex="1" />
  654. </Border>
  655. <Border
  656. x:Name="contentPanel"
  657. Grid.Column="1"
  658. Background="{TemplateBinding Background}"
  659. BorderBrush="{TemplateBinding BorderBrush}"
  660. BorderThickness="{TemplateBinding BorderThickness}"
  661. KeyboardNavigation.DirectionalNavigation="Contained"
  662. KeyboardNavigation.TabIndex="2"
  663. KeyboardNavigation.TabNavigation="Local">
  664. <ContentPresenter
  665. x:Name="PART_SelectedContentHost"
  666. Margin="{TemplateBinding Margin}"
  667. HorizontalAlignment="Right"
  668. VerticalAlignment="Center"
  669. ContentSource="SelectedContent"
  670. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  671. </Border>
  672. </Grid>
  673. <ControlTemplate.Triggers>
  674. <Trigger Property="TabStripPlacement" Value="Bottom">
  675. <Setter TargetName="headerPanel" Property="Grid.Row" Value="1" />
  676. <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
  677. <Setter TargetName="headerPanel" Property="Margin" Value="2,0,2,2" />
  678. </Trigger>
  679. <Trigger Property="TabStripPlacement" Value="Left">
  680. <Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
  681. <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
  682. <Setter TargetName="headerPanel" Property="Grid.Column" Value="0" />
  683. <Setter TargetName="contentPanel" Property="Grid.Column" Value="1" />
  684. <Setter TargetName="ColumnDefinition0" Property="Width" Value="Auto" />
  685. <Setter TargetName="ColumnDefinition1" Property="Width" Value="*" />
  686. <Setter TargetName="headerPanel" Property="Margin" Value="2,2,0,2" />
  687. </Trigger>
  688. <Trigger Property="TabStripPlacement" Value="Right">
  689. <Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
  690. <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
  691. <Setter TargetName="headerPanel" Property="Grid.Column" Value="1" />
  692. <Setter TargetName="contentPanel" Property="Grid.Column" Value="0" />
  693. <Setter TargetName="ColumnDefinition0" Property="Width" Value="*" />
  694. <Setter TargetName="ColumnDefinition1" Property="Width" Value="Auto" />
  695. <Setter TargetName="headerPanel" Property="Margin" Value="0,2,2,2" />
  696. </Trigger>
  697. <Trigger Property="IsEnabled" Value="false">
  698. <Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  699. </Trigger>
  700. </ControlTemplate.Triggers>
  701. </ControlTemplate>
  702. </Setter.Value>
  703. </Setter>
  704. </Style>
  705. <Style x:Key="InfoTabItem" TargetType="{x:Type TabItem}">
  706. <Setter Property="Height" Value="50" />
  707. <Setter Property="Width" Value="200" />
  708. <Setter Property="Template">
  709. <Setter.Value>
  710. <ControlTemplate TargetType="{x:Type TabItem}">
  711. <Grid>
  712. <Border
  713. Name="Border"
  714. Height="32"
  715. Padding="8,0"
  716. Background="Transparent"
  717. BorderBrush="Transparent"
  718. BorderThickness="1"
  719. CornerRadius="4">
  720. <ContentPresenter
  721. x:Name="ContentSite"
  722. HorizontalAlignment="Left"
  723. VerticalAlignment="Center"
  724. ContentSource="Header"
  725. RecognizesAccessKey="True" />
  726. </Border>
  727. </Grid>
  728. <ControlTemplate.Triggers>
  729. <Trigger Property="IsSelected" Value="True">
  730. <Setter Property="Panel.ZIndex" Value="100" />
  731. <Setter TargetName="Border" Property="Background" Value="{StaticResource color.item-state.sel.bg.lv1}" />
  732. <Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" />
  733. </Trigger>
  734. <Trigger Property="IsSelected" Value="False">
  735. <Setter Property="Panel.ZIndex" Value="100" />
  736. <Setter TargetName="Border" Property="Background" Value="Transparent" />
  737. <Setter TargetName="Border" Property="BorderThickness" Value="1,1,1,0" />
  738. </Trigger>
  739. </ControlTemplate.Triggers>
  740. </ControlTemplate>
  741. </Setter.Value>
  742. </Setter>
  743. </Style>
  744. <!--<Style x:Key="InfoTabItem" TargetType="{x:Type TabItem}">
  745. <Setter Property="HeaderTemplate">
  746. <Setter.Value>
  747. -->
  748. <!--<DataTemplate>
  749. <DataTemplate.Triggers>
  750. <Trigger Property="IsSelected" Value="True">
  751. <Setter TargetName="img" Property="Source" Value="images/customimage.png" />
  752. </Trigger>
  753. </DataTemplate.Triggers>
  754. </DataTemplate>-->
  755. <!--
  756. <ControlTemplate TargetType="{x:Type TabItem}">
  757. <ContentPresenter />
  758. <ControlTemplate.Triggers>
  759. <Trigger Property="IsSelected" Value="True">
  760. <Setter TargetName="img" Property="Source" Value="images/customimage.png" />
  761. </Trigger>
  762. </ControlTemplate.Triggers>
  763. </ControlTemplate>
  764. </Setter.Value>
  765. </Setter>
  766. </Style>-->
  767. </ResourceDictionary>