TabControlBaseStyle.xaml 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:hc="clr-namespace:HandyControl.Controls" xmlns:langs="clr-namespace:HandyControl.Properties.Langs" xmlns:interactivity="clr-namespace:HandyControl.Interactivity" xmlns:system="clr-namespace:System;assembly=mscorlib">
  2. <Style x:Key="TabItemStyle" TargetType="TabItem">
  3. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  4. <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
  5. <Setter Property="Background" Value="{DynamicResource RegionBrush}" />
  6. <Setter Property="BorderBrush" Value="{DynamicResource TitleBrush}" />
  7. <Setter Property="Margin" Value="0" />
  8. <Setter Property="Padding" Value="{StaticResource DefaultControlPadding}" />
  9. <Setter Property="MinHeight" Value="{StaticResource DefaultControlHeight}" />
  10. <Setter Property="HorizontalContentAlignment" Value="Stretch" />
  11. <Setter Property="VerticalContentAlignment" Value="Stretch" />
  12. <Setter Property="Template">
  13. <Setter.Value>
  14. <ControlTemplate TargetType="TabItem">
  15. <hc:SimplePanel x:Name="templateRoot" SnapsToDevicePixels="true">
  16. <Border x:Name="mainBorder" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="0" Background="{TemplateBinding Background}" Margin="0" />
  17. <ContentPresenter x:Name="contentPresenter" TextElement.Foreground="{DynamicResource PrimaryTextBrush}" ContentSource="Header" Focusable="False" HorizontalAlignment="Center" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" />
  18. </hc:SimplePanel>
  19. <ControlTemplate.Triggers>
  20. <Trigger Property="IsSelected" Value="False">
  21. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,0" />
  22. </Trigger>
  23. <Trigger Property="IsEnabled" Value="False">
  24. <Setter Property="Opacity" Value="0.4" TargetName="contentPresenter" />
  25. </Trigger>
  26. <MultiDataTrigger>
  27. <MultiDataTrigger.Conditions>
  28. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
  29. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType=TabControl}}" Value="Top" />
  30. </MultiDataTrigger.Conditions>
  31. <Setter Property="Panel.ZIndex" Value="1" />
  32. <Setter Property="TextElement.Foreground" Value="{DynamicResource PrimaryBrush}" TargetName="contentPresenter" />
  33. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,0,2" />
  34. </MultiDataTrigger>
  35. <MultiDataTrigger>
  36. <MultiDataTrigger.Conditions>
  37. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
  38. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType=TabControl}}" Value="Left" />
  39. </MultiDataTrigger.Conditions>
  40. <Setter Property="Panel.ZIndex" Value="1" />
  41. <Setter Property="TextElement.Foreground" Value="{DynamicResource PrimaryBrush}" TargetName="contentPresenter" />
  42. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,0,2,0" />
  43. </MultiDataTrigger>
  44. <MultiDataTrigger>
  45. <MultiDataTrigger.Conditions>
  46. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
  47. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType=TabControl}}" Value="Bottom" />
  48. </MultiDataTrigger.Conditions>
  49. <Setter Property="Panel.ZIndex" Value="1" />
  50. <Setter Property="TextElement.Foreground" Value="{DynamicResource PrimaryBrush}" TargetName="contentPresenter" />
  51. <Setter Property="BorderThickness" TargetName="mainBorder" Value="0,2,0,0" />
  52. </MultiDataTrigger>
  53. <MultiDataTrigger>
  54. <MultiDataTrigger.Conditions>
  55. <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true" />
  56. <Condition Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType=TabControl}}" Value="Right" />
  57. </MultiDataTrigger.Conditions>
  58. <Setter Property="Panel.ZIndex" Value="1" />
  59. <Setter Property="TextElement.Foreground" Value="{DynamicResource PrimaryBrush}" TargetName="contentPresenter" />
  60. <Setter Property="BorderThickness" TargetName="mainBorder" Value="2,0,0,0" />
  61. </MultiDataTrigger>
  62. </ControlTemplate.Triggers>
  63. </ControlTemplate>
  64. </Setter.Value>
  65. </Setter>
  66. </Style>
  67. <Style x:Key="TabControlBaseStyle" TargetType="TabControl">
  68. <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" />
  69. <Setter Property="Background" Value="{DynamicResource RegionBrush}" />
  70. <Setter Property="BorderThickness" Value="1" />
  71. <Setter Property="Foreground" Value="White" />
  72. <Setter Property="ItemContainerStyle" Value="{StaticResource TabItemStyle}" />
  73. <Setter Property="Template">
  74. <Setter.Value>
  75. <ControlTemplate TargetType="TabControl">
  76. <Grid x:Name="templateRoot" Background="{TemplateBinding Background}" ClipToBounds="true" SnapsToDevicePixels="true">
  77. <Grid.ColumnDefinitions>
  78. <ColumnDefinition x:Name="ColumnDefinition0" />
  79. <ColumnDefinition x:Name="ColumnDefinition1" Width="0" />
  80. </Grid.ColumnDefinitions>
  81. <Grid.RowDefinitions>
  82. <RowDefinition x:Name="RowDefinition0" Height="Auto" />
  83. <RowDefinition x:Name="RowDefinition1" Height="*" />
  84. </Grid.RowDefinitions>
  85. <TabPanel x:Name="headerPanel" Background="Transparent" Grid.Column="0" IsItemsHost="true" Margin="0" Grid.Row="0"/>
  86. <Border x:Name="contentPanel" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{DynamicResource BorderBrush}" Background="{TemplateBinding Background}" Grid.Column="0" Grid.Row="1">
  87. <ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  88. </Border>
  89. </Grid>
  90. <ControlTemplate.Triggers>
  91. <Trigger Property="TabStripPlacement" Value="Bottom">
  92. <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
  93. <Setter TargetName="RowDefinition1" Property="Height" Value="Auto" />
  94. <Setter TargetName="headerPanel" Property="Grid.Row" Value="1" />
  95. <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
  96. </Trigger>
  97. <Trigger Property="TabStripPlacement" Value="Left">
  98. <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
  99. <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
  100. <Setter TargetName="ColumnDefinition0" Property="Width" Value="Auto" />
  101. <Setter TargetName="ColumnDefinition1" Property="Width" Value="*" />
  102. <Setter TargetName="headerPanel" Property="Grid.Column" Value="0" />
  103. <Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
  104. <Setter TargetName="contentPanel" Property="Grid.Column" Value="1" />
  105. <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
  106. </Trigger>
  107. <Trigger Property="TabStripPlacement" Value="Right">
  108. <Setter TargetName="RowDefinition0" Property="Height" Value="*" />
  109. <Setter TargetName="RowDefinition1" Property="Height" Value="0" />
  110. <Setter TargetName="ColumnDefinition0" Property="Width" Value="*" />
  111. <Setter TargetName="ColumnDefinition1" Property="Width" Value="Auto" />
  112. <Setter TargetName="headerPanel" Property="Grid.Column" Value="1" />
  113. <Setter TargetName="headerPanel" Property="Grid.Row" Value="0" />
  114. <Setter TargetName="contentPanel" Property="Grid.Column" Value="0" />
  115. <Setter TargetName="contentPanel" Property="Grid.Row" Value="0" />
  116. </Trigger>
  117. </ControlTemplate.Triggers>
  118. </ControlTemplate>
  119. </Setter.Value>
  120. </Setter>
  121. </Style>
  122. <Style x:Key="TabItemCapsuleBaseStyle" TargetType="TabItem">
  123. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  124. <Setter Property="Background" Value="{DynamicResource RegionBrush}" />
  125. <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" />
  126. <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
  127. <Setter Property="BorderThickness" Value="1" />
  128. <Setter Property="VerticalAlignment" Value="Center" />
  129. <Setter Property="hc:BorderElement.CornerRadius" Value="0" />
  130. <Setter Property="MinHeight" Value="{StaticResource DefaultControlHeight}" />
  131. <Setter Property="Padding" Value="10,0" />
  132. <Setter Property="Margin" Value="-1,0,0,0" />
  133. <Setter Property="Template">
  134. <Setter.Value>
  135. <ControlTemplate TargetType="TabItem">
  136. <Border x:Name="BorderRoot" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
  137. <ContentPresenter x:Name="contentPresenter" ContentSource="Header" TextElement.Foreground="{TemplateBinding Foreground}" Focusable="False" HorizontalAlignment="Center" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" />
  138. </Border>
  139. <ControlTemplate.Triggers>
  140. <Trigger Property="IsMouseOver" Value="True">
  141. <Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}" TargetName="BorderRoot" />
  142. <Setter Property="TextElement.Foreground" Value="{DynamicResource PrimaryBrush}" TargetName="contentPresenter" />
  143. </Trigger>
  144. <Trigger Property="IsSelected" Value="true">
  145. <Setter Property="BorderBrush" Value="{Binding Path=(hc:TitleElement.BorderBrush),RelativeSource={RelativeSource TemplatedParent}}" TargetName="BorderRoot" />
  146. <Setter Property="Background" Value="{Binding Path=(hc:TitleElement.Background),RelativeSource={RelativeSource TemplatedParent}}" TargetName="BorderRoot" />
  147. <Setter Property="TextElement.Foreground" Value="{Binding Path=(hc:TitleElement.Foreground),RelativeSource={RelativeSource TemplatedParent}}" TargetName="contentPresenter" />
  148. </Trigger>
  149. <DataTrigger Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType=TabControl}}" Value="Left">
  150. <Setter Property="Margin" Value="0,-1,0,0" />
  151. </DataTrigger>
  152. <DataTrigger Binding="{Binding TabStripPlacement, RelativeSource={RelativeSource AncestorType=TabControl}}" Value="Right">
  153. <Setter Property="Margin" Value="0,-1,0,0" />
  154. </DataTrigger>
  155. <Trigger Property="IsEnabled" Value="False">
  156. <Setter Property="Opacity" Value="0.4" TargetName="contentPresenter" />
  157. </Trigger>
  158. </ControlTemplate.Triggers>
  159. </ControlTemplate>
  160. </Setter.Value>
  161. </Setter>
  162. <Style.Triggers>
  163. <Trigger Property="IsSelected" Value="True">
  164. <Setter Property="Panel.ZIndex" Value="{x:Static system:Int32.MaxValue}" />
  165. </Trigger>
  166. </Style.Triggers>
  167. </Style>
  168. <ContextMenu x:Key="TabItemMenu" x:Shared="False">
  169. <MenuItem Command="interactivity:ControlCommands.Close" Header="{x:Static langs:Lang.Close}" />
  170. <MenuItem Command="interactivity:ControlCommands.CloseAll" Header="{x:Static langs:Lang.CloseAll}" />
  171. <MenuItem Command="interactivity:ControlCommands.CloseOther" Header="{x:Static langs:Lang.CloseOther}" />
  172. </ContextMenu>
  173. <Style x:Key="TabItemPlusBaseStyle" TargetType="hc:TabItem">
  174. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  175. <Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}" />
  176. <Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}" />
  177. <Setter Property="BorderThickness" Value="1,0,1,1" />
  178. <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" />
  179. <Setter Property="Margin" Value="0" />
  180. <Setter Property="Padding" Value="10,0,0,0" />
  181. <Setter Property="HorizontalContentAlignment" Value="Stretch" />
  182. <Setter Property="VerticalContentAlignment" Value="Stretch" />
  183. <Setter Property="Menu" Value="{StaticResource TabItemMenu}" />
  184. <Setter Property="Template">
  185. <Setter.Value>
  186. <ControlTemplate TargetType="hc:TabItem">
  187. <Grid x:Name="templateRoot" SnapsToDevicePixels="true" ContextMenu="{TemplateBinding Menu}">
  188. <Grid.ColumnDefinitions>
  189. <ColumnDefinition Width="Auto" />
  190. <ColumnDefinition />
  191. <ColumnDefinition Width="Auto" />
  192. </Grid.ColumnDefinitions>
  193. <Border Grid.ColumnSpan="3" BorderThickness="{TemplateBinding BorderThickness}" x:Name="mainBorder" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Margin="0">
  194. <Border Margin="0,0,0,-1" x:Name="innerBorder" Background="{DynamicResource RegionBrush}" Visibility="Collapsed" />
  195. </Border>
  196. <Path x:Name="PathMain" Margin="10,0,0,0" Grid.Column="0" Width="{TemplateBinding hc:IconElement.Width}" Height="{TemplateBinding hc:IconElement.Height}" Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Data="{TemplateBinding hc:IconElement.Geometry}" />
  197. <ContentPresenter Grid.Column="1" x:Name="contentPresenter" ContentSource="Header" Focusable="False" HorizontalAlignment="Stretch" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="Center" />
  198. <Border Name="BorderMask" Grid.Column="1" HorizontalAlignment="Right" Width="20" Background="{TemplateBinding Background}" Margin="0,0,1,1">
  199. <Border.OpacityMask>
  200. <LinearGradientBrush EndPoint="1,0" StartPoint="0,0">
  201. <GradientStop Color="White" Offset="1" />
  202. <GradientStop Offset="0" />
  203. </LinearGradientBrush>
  204. </Border.OpacityMask>
  205. </Border>
  206. <Button Grid.Column="2" Focusable="False" Command="interactivity:ControlCommands.Close" Visibility="{TemplateBinding ShowCloseButton,Converter={StaticResource Boolean2VisibilityConverter}}" Background="Transparent" Style="{StaticResource ButtonCustom}" Width="28">
  207. <Path Fill="{DynamicResource PrimaryTextBrush}" Width="8" Height="8" Style="{StaticResource ClosePathStyle}" />
  208. </Button>
  209. </Grid>
  210. <ControlTemplate.Triggers>
  211. <Trigger Property="IsSelected" Value="true">
  212. <Setter Property="Panel.ZIndex" Value="1" />
  213. <Setter Property="Visibility" TargetName="innerBorder" Value="Visible" />
  214. <Setter Property="Background" TargetName="BorderMask" Value="{DynamicResource RegionBrush}" />
  215. </Trigger>
  216. <Trigger Property="hc:IconElement.Geometry" Value="{x:Null}">
  217. <Setter Property="Visibility" Value="Collapsed" TargetName="PathMain" />
  218. </Trigger>
  219. <Trigger Property="ShowCloseButton" Value="True">
  220. <Setter Property="Margin" Value="0,0,0,1" TargetName="BorderMask" />
  221. </Trigger>
  222. <Trigger Property="IsEnabled" Value="False">
  223. <Setter Property="Opacity" Value="0.4" TargetName="contentPresenter" />
  224. </Trigger>
  225. </ControlTemplate.Triggers>
  226. </ControlTemplate>
  227. </Setter.Value>
  228. </Setter>
  229. </Style>
  230. <ControlTemplate x:Key="TabControlPlusTemplate" TargetType="hc:TabControl">
  231. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
  232. <Grid x:Name="templateRoot" ClipToBounds="true" SnapsToDevicePixels="true">
  233. <Grid.ColumnDefinitions>
  234. <ColumnDefinition x:Name="ColumnDefinition0" />
  235. <ColumnDefinition x:Name="ColumnDefinition1" Width="0" />
  236. </Grid.ColumnDefinitions>
  237. <Grid.RowDefinitions>
  238. <RowDefinition Height="Auto" />
  239. <RowDefinition Height="*" />
  240. </Grid.RowDefinitions>
  241. <Border Background="{TemplateBinding Background}" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource BorderBrush}">
  242. <hc:TabPanel MinHeight="{TemplateBinding TabItemHeight}" TabItemHeight="{TemplateBinding TabItemHeight}" TabItemWidth="{TemplateBinding TabItemWidth}" IsTabFillEnabled="{TemplateBinding IsTabFillEnabled}" Margin="0,0,-1,-1" x:Name="PART_HeaderPanel" HorizontalAlignment="Left" Background="{DynamicResource SecondaryTextBrush}" IsItemsHost="true">
  243. <interactivity:Interaction.Behaviors>
  244. <interactivity:FluidMoveBehavior AppliesTo="Children" Duration="{Binding FluidMoveDuration,ElementName=PART_HeaderPanel}">
  245. <interactivity:FluidMoveBehavior.EaseX>
  246. <CubicEase EasingMode="EaseOut" />
  247. </interactivity:FluidMoveBehavior.EaseX>
  248. </interactivity:FluidMoveBehavior>
  249. </interactivity:Interaction.Behaviors>
  250. </hc:TabPanel>
  251. </Border>
  252. <Border x:Name="contentPanel" Background="{DynamicResource SecondaryRegionBrush}" Grid.Column="0" Grid.Row="1">
  253. <ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  254. </Border>
  255. <Border Visibility="{Binding Visibility,ElementName=PART_OverflowButton}" Margin="0,-1,0,0" Grid.Row="0" Grid.Column="0" BorderThickness="1,0,0,1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" HorizontalAlignment="Right">
  256. <hc:ContextMenuToggleButton x:Name="PART_OverflowButton" Visibility="Collapsed" Padding="0" hc:IconElement.Width="14" Height="Auto" BorderThickness="0" Background="{DynamicResource SecondaryRegionBrush}" Style="{StaticResource ToggleButtonIconTransparent}" hc:IconSwitchElement.Geometry="{StaticResource DownGeometry}" hc:IconSwitchElement.GeometrySelected="{StaticResource UpGeometry}" />
  257. </Border>
  258. </Grid>
  259. </Border>
  260. </ControlTemplate>
  261. <ControlTemplate x:Key="TabControlPlusScrollableTemplate" TargetType="hc:TabControl">
  262. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}">
  263. <Grid x:Name="templateRoot" ClipToBounds="true" SnapsToDevicePixels="true">
  264. <Grid.ColumnDefinitions>
  265. <ColumnDefinition Width="Auto" />
  266. <ColumnDefinition />
  267. <ColumnDefinition Width="Auto" />
  268. </Grid.ColumnDefinitions>
  269. <Grid.RowDefinitions>
  270. <RowDefinition Height="Auto" />
  271. <RowDefinition Height="*" />
  272. </Grid.RowDefinitions>
  273. <Border Visibility="{TemplateBinding ShowScrollButton,Converter={StaticResource Boolean2VisibilityConverter}}" Margin="0,-1,0,0" Grid.Row="0" Grid.Column="0" BorderThickness="0,0,1,1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" HorizontalAlignment="Left" Panel.ZIndex="2">
  274. <Border.CacheMode>
  275. <BitmapCache SnapsToDevicePixels="True" />
  276. </Border.CacheMode>
  277. <RepeatButton Focusable="False" Style="{StaticResource RepeatButtonIcon}" BorderThickness="0" hc:IconElement.Height="14" Padding="8 0" Height="Auto" VerticalAlignment="Stretch" Width="{StaticResource DefaultControlHeight}" hc:IconElement.Geometry="{StaticResource LeftGeometry}" Foreground="{DynamicResource PrimaryTextBrush}" Background="{DynamicResource SecondaryRegionBrush}" x:Name="PART_ScrollButtonLeft" />
  278. </Border>
  279. <hc:ScrollViewer HorizontalScrollBarVisibility="Hidden" CanMouseWheel="True" hc:ScrollViewerAttach.Orientation="Horizontal" IsInertiaEnabled="True" Grid.Row="0" Grid.Column="1" IsDeferredScrollingEnabled="True" x:Name="PART_OverflowScrollviewer">
  280. <Border Background="{TemplateBinding Background}" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource BorderBrush}" Name="PART_HeaderBorder">
  281. <hc:TabPanel MinHeight="{TemplateBinding TabItemHeight}" TabItemHeight="{TemplateBinding TabItemHeight}" TabItemWidth="{TemplateBinding TabItemWidth}" IsTabFillEnabled="{TemplateBinding IsTabFillEnabled}" Margin="0,0,-1,-1" x:Name="PART_HeaderPanel" HorizontalAlignment="Left" Background="{DynamicResource SecondaryTextBrush}" IsItemsHost="true">
  282. <interactivity:Interaction.Behaviors>
  283. <interactivity:FluidMoveBehavior AppliesTo="Children" Duration="{Binding FluidMoveDuration,ElementName=PART_HeaderPanel}">
  284. <interactivity:FluidMoveBehavior.EaseX>
  285. <CubicEase EasingMode="EaseOut" />
  286. </interactivity:FluidMoveBehavior.EaseX>
  287. </interactivity:FluidMoveBehavior>
  288. </interactivity:Interaction.Behaviors>
  289. </hc:TabPanel>
  290. </Border>
  291. </hc:ScrollViewer>
  292. <Border Margin="0,-1,0,0" Grid.Row="0" Grid.Column="2" BorderThickness="1,0,0,1" BorderBrush="{DynamicResource BorderBrush}" Background="{DynamicResource RegionBrush}" HorizontalAlignment="Right">
  293. <Border.CacheMode>
  294. <BitmapCache SnapsToDevicePixels="True" />
  295. </Border.CacheMode>
  296. <StackPanel Orientation="Horizontal">
  297. <RepeatButton Focusable="False" Visibility="{TemplateBinding ShowScrollButton,Converter={StaticResource Boolean2VisibilityConverter}}" Style="{StaticResource RepeatButtonIcon}" BorderThickness="0" hc:IconElement.Height="14" Padding="8 0" Height="Auto" VerticalAlignment="Stretch" Width="{StaticResource DefaultControlHeight}" hc:IconElement.Geometry="{StaticResource RightGeometry}" Foreground="{DynamicResource PrimaryTextBrush}" Background="{DynamicResource SecondaryRegionBrush}" x:Name="PART_ScrollButtonRight" />
  298. <Border Visibility="{Binding Visibility,ElementName=PART_OverflowButton}" Width="1" Background="{DynamicResource BorderBrush}" />
  299. <hc:ContextMenuToggleButton x:Name="PART_OverflowButton" Visibility="Collapsed" Padding="0" hc:IconElement.Width="14" Height="Auto" BorderThickness="0" Background="{DynamicResource SecondaryRegionBrush}" Style="{StaticResource ToggleButtonIconTransparent}" hc:IconSwitchElement.Geometry="{StaticResource DownGeometry}" hc:IconSwitchElement.GeometrySelected="{StaticResource UpGeometry}" />
  300. </StackPanel>
  301. </Border>
  302. <Border x:Name="contentPanel" Background="{DynamicResource SecondaryRegionBrush}" Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="3">
  303. <ContentPresenter x:Name="PART_SelectedContentHost" ContentSource="SelectedContent" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  304. </Border>
  305. </Grid>
  306. </Border>
  307. </ControlTemplate>
  308. <Style x:Key="TabControlPlusBaseStyle" TargetType="hc:TabControl">
  309. <Setter Property="Padding" Value="0" />
  310. <Setter Property="Background" Value="{DynamicResource SecondaryRegionBrush}" />
  311. <Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}" />
  312. <Setter Property="HorizontalContentAlignment" Value="Center" />
  313. <Setter Property="VerticalContentAlignment" Value="Center" />
  314. <Setter Property="BorderThickness" Value="1" />
  315. <Setter Property="ItemContainerStyle" Value="{StaticResource TabItemPlusBaseStyle}" />
  316. <Setter Property="Template" Value="{StaticResource TabControlPlusTemplate}" />
  317. <Style.Triggers>
  318. <MultiTrigger>
  319. <MultiTrigger.Conditions>
  320. <Condition Property="IsScrollable" Value="True" />
  321. <Condition Property="IsTabFillEnabled" Value="False" />
  322. </MultiTrigger.Conditions>
  323. <Setter Property="Template" Value="{StaticResource TabControlPlusScrollableTemplate}" />
  324. </MultiTrigger>
  325. </Style.Triggers>
  326. </Style>
  327. <Style x:Key="SlidingTabContainerBaseStyle" TargetType="hc:SlidingTabContainer">
  328. <Setter Property="FocusVisualStyle" Value="{x:Null}" />
  329. <Setter Property="Focusable" Value="False" />
  330. <Setter Property="VerticalAlignment" Value="Center" />
  331. <Setter Property="HorizontalAlignment" Value="Center" />
  332. <Setter Property="Padding" Value="2" />
  333. <Setter Property="Template">
  334. <Setter.Value>
  335. <ControlTemplate TargetType="hc:SlidingTabContainer">
  336. <Border HorizontalAlignment="Center" VerticalAlignment="Center" Padding="{TemplateBinding Padding}" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
  337. <hc:SimplePanel>
  338. <Border x:Name="PART_Sliding" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" Width="0" Height="0" Effect="{StaticResource EffectShadow1}" Background="{Binding Path=(hc:TitleElement.Background),RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Left" VerticalAlignment="Top">
  339. <Border.RenderTransform>
  340. <TranslateTransform />
  341. </Border.RenderTransform>
  342. </Border>
  343. <ContentPresenter />
  344. </hc:SimplePanel>
  345. </Border>
  346. </ControlTemplate>
  347. </Setter.Value>
  348. </Setter>
  349. </Style>
  350. </ResourceDictionary>