Generic.xaml 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  1. <ResourceDictionary
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:local="clr-namespace:InABox.DynamicGrid"
  5. xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
  6. xmlns:themes="clr-namespace:InABox.WPF.Themes;assembly=InABox.Wpf"
  7. x:Class="InABox.DynamicGrid.Generic"
  8. x:ClassModifier="public">
  9. <!-- VerticalSplitter -->
  10. <ControlTemplate x:Key="VerticalSplitter">
  11. <Grid Background="{TemplateBinding Background}" Width="4">
  12. <Button x:Name="PART_Left" Visibility="Collapsed" />
  13. <Button x:Name="PART_Right" Visibility="Collapsed" />
  14. <StackPanel Margin="0" Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center">
  15. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="0,2,0,0" />
  16. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="0,2,0,0" />
  17. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="0,2,0,0" />
  18. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="0,2,0,0" />
  19. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="0,2,0,0" />
  20. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="0,2,0,0" />
  21. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="0,2,0,0" />
  22. </StackPanel>
  23. </Grid>
  24. </ControlTemplate>
  25. <!-- HorizontalSplitter -->
  26. <ControlTemplate x:Key="HorizontalSplitter">
  27. <Grid Background="{TemplateBinding Background}" Height="4">
  28. <Button x:Name="PART_Left" Visibility="Collapsed" />
  29. <Button x:Name="PART_Right" Visibility="Collapsed" />
  30. <StackPanel Margin="0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
  31. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="2,0,0,0" />
  32. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="2,0,0,0" />
  33. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="2,0,0,0" />
  34. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="2,0,0,0" />
  35. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="2,0,0,0" />
  36. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="2,0,0,0" />
  37. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="2,0,0,0" />
  38. </StackPanel>
  39. </Grid>
  40. </ControlTemplate>
  41. <!-- DynamicSplitPanel -->
  42. <Style TargetType="{x:Type local:DynamicSplitPanel}">
  43. <Setter Property="Template">
  44. <Setter.Value>
  45. <ControlTemplate TargetType="{x:Type local:DynamicSplitPanel}">
  46. <Grid x:Name="PART_Grid">
  47. <Grid.ColumnDefinitions>
  48. <ColumnDefinition Width="0" />
  49. <ColumnDefinition Width="Auto" />
  50. <ColumnDefinition Width="Auto" />
  51. <ColumnDefinition Width="*" />
  52. <ColumnDefinition Width="0" />
  53. </Grid.ColumnDefinitions>
  54. <Grid.RowDefinitions>
  55. <RowDefinition Height="Auto" />
  56. <RowDefinition Height="*" />
  57. </Grid.RowDefinitions>
  58. <DockPanel Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Margin="0,0,2,0">
  59. <Button DockPanel.Dock="Top" x:Name="PART_DetailsOnly" BorderBrush="Gray"
  60. BorderThickness="0.75" Margin="0" Background="WhiteSmoke" MinHeight="25"
  61. MinWidth="25">
  62. <Polygon Points="0,0 8,5, 0,10" Stroke="Gray" Fill="Silver" />
  63. </Button>
  64. <Border DockPanel.Dock="Top" BorderBrush="Gray" BorderThickness="0.75" Margin="0,2,0,0"
  65. Background="WhiteSmoke">
  66. <Label x:Name="PART_MasterHeader"
  67. Content="{Binding MasterCaption, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}"
  68. HorizontalContentAlignment="Right">
  69. <Label.LayoutTransform>
  70. <RotateTransform Angle="270" />
  71. </Label.LayoutTransform>
  72. </Label>
  73. </Border>
  74. </DockPanel>
  75. <DockPanel Grid.Row="0" Grid.Column="1">
  76. <Button x:Name="PART_CombinedRight" BorderBrush="Gray" BorderThickness="0.75"
  77. Margin="2,0,0,2" Background="WhiteSmoke" DockPanel.Dock="Right" MinWidth="25"
  78. MinHeight="25" HorizontalContentAlignment="Center"
  79. VerticalContentAlignment="Center">
  80. <Polygon Points="0,0 8,5, 0,10" Stroke="Gray" Fill="Silver" />
  81. </Button>
  82. <Button x:Name="PART_CombinedLeft" BorderBrush="Gray" BorderThickness="0.75"
  83. Margin="2,0,0,2" Background="WhiteSmoke" DockPanel.Dock="Right" MinWidth="25"
  84. MinHeight="25">
  85. <Polygon Points="8,0 0,5, 8,10" Stroke="Gray" Fill="Silver" />
  86. </Button>
  87. <ContentPresenter DockPanel.Dock="Left" MinHeight="25" Margin="0,0,0,2"
  88. Content="{Binding Header, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}" />
  89. </DockPanel>
  90. <ContentPresenter Grid.Row="1" Grid.Column="1"
  91. Content="{Binding Master, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}" />
  92. <syncfusion:SfGridSplitter Grid.Row="0" Grid.RowSpan="2" Grid.Column="2" Name="PART_Splitter"
  93. ResizeBehavior="PreviousAndNext" Width="4" Background="Transparent"
  94. Template="{StaticResource VerticalSplitter}">
  95. <syncfusion:SfGridSplitter.PreviewStyle>
  96. <Style TargetType="Control">
  97. <Setter Property="Background" Value="Gray" />
  98. <Setter Property="Template">
  99. <Setter.Value>
  100. <ControlTemplate TargetType="Control">
  101. <Grid x:Name="Root" Opacity="0.5">
  102. <Rectangle Fill="{TemplateBinding Background}" />
  103. </Grid>
  104. </ControlTemplate>
  105. </Setter.Value>
  106. </Setter>
  107. </Style>
  108. </syncfusion:SfGridSplitter.PreviewStyle>
  109. </syncfusion:SfGridSplitter>
  110. <ContentPresenter Grid.Row="0" Grid.Column="3" Margin="0,0,0,2"
  111. Content="{Binding DetailHeader, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}" />
  112. <Grid x:Name="PART_DetailGrid" Grid.Row="1" Grid.Column="3">
  113. <Grid.RowDefinitions>
  114. <RowDefinition Height="*" />
  115. <RowDefinition Height="Auto" />
  116. <RowDefinition Height="*" />
  117. </Grid.RowDefinitions>
  118. <ContentPresenter Grid.Row="0"
  119. Content="{Binding Detail, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}" />
  120. <syncfusion:SfGridSplitter Grid.Row="1" Name="PART_DetailSplitter"
  121. ResizeBehavior="PreviousAndNext" Height="4"
  122. HorizontalAlignment="Stretch" Background="Transparent"
  123. Template="{StaticResource HorizontalSplitter}">
  124. <syncfusion:SfGridSplitter.PreviewStyle>
  125. <Style TargetType="Control">
  126. <Setter Property="Background" Value="Gray" />
  127. <Setter Property="Template">
  128. <Setter.Value>
  129. <ControlTemplate TargetType="Control">
  130. <Grid x:Name="Root" Opacity="0.5">
  131. <Rectangle Fill="{TemplateBinding Background}" />
  132. </Grid>
  133. </ControlTemplate>
  134. </Setter.Value>
  135. </Setter>
  136. </Style>
  137. </syncfusion:SfGridSplitter.PreviewStyle>
  138. </syncfusion:SfGridSplitter>
  139. <ContentPresenter Grid.Row="2"
  140. Content="{Binding SecondaryDetail, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}" />
  141. </Grid>
  142. <DockPanel Grid.Row="0" Grid.Column="4" Grid.RowSpan="2" Margin="2,0,0,0">
  143. <Button DockPanel.Dock="Top" x:Name="PART_MasterOnly" BorderBrush="Gray"
  144. BorderThickness="0.75" Margin="0" Background="WhiteSmoke" MinHeight="25"
  145. MinWidth="25">
  146. <Polygon Points="8,0 0,5, 8,10" Stroke="Gray" Fill="Silver" />
  147. </Button>
  148. <Border DockPanel.Dock="Top" BorderBrush="Gray" BorderThickness="0.75" Margin="0,2,0,0"
  149. Background="WhiteSmoke">
  150. <Label x:Name="PART_DetailHeader"
  151. Content="{Binding DetailCaption, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}"
  152. HorizontalContentAlignment="Right">
  153. <Label.LayoutTransform>
  154. <RotateTransform Angle="270" />
  155. </Label.LayoutTransform>
  156. </Label>
  157. </Border>
  158. </DockPanel>
  159. </Grid>
  160. </ControlTemplate>
  161. </Setter.Value>
  162. </Setter>
  163. </Style>
  164. <Style TargetType="syncfusion:GridFilterControl">
  165. <Setter Property="SortOptionVisibility" Value="Collapsed" />
  166. </Style>
  167. <!-- VerticalColumnHeader -->
  168. <Style x:Key="ActionColumnHeader" TargetType="{x:Type syncfusion:GridHeaderCellControl}">
  169. <Setter Property="Background" Value="LightSkyBlue" />
  170. <Setter Property="Foreground" Value="Black" />
  171. <Setter Property="BorderBrush" Value="Black" />
  172. <Setter Property="BorderThickness" Value="0.5,0.5,0.5,0.5" />
  173. <Setter Property="HorizontalContentAlignment" Value="Left" />
  174. <Setter Property="Padding" Value="5,3" />
  175. <Setter Property="FontFamily" Value="Segoe UI" />
  176. <Setter Property="FontSize" Value="14" />
  177. <Setter Property="FontWeight" Value="Normal" />
  178. <Setter Property="IsTabStop" Value="False" />
  179. <Setter Property="Template">
  180. <Setter.Value>
  181. <ControlTemplate TargetType="{x:Type syncfusion:GridHeaderCellControl}">
  182. <Grid>
  183. <Grid.LayoutTransform>
  184. <RotateTransform Angle="90" />
  185. </Grid.LayoutTransform>
  186. <VisualStateManager.VisualStateGroups>
  187. <VisualStateGroup x:Name="HiddenColumnsResizingStates">
  188. <VisualState x:Name="PreviousColumnHidden">
  189. <Storyboard>
  190. <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
  191. Storyboard.TargetProperty="BorderThickness"
  192. Storyboard.TargetName="PART_HeaderCellBorder">
  193. <EasingThicknessKeyFrame KeyTime="0" Value="3,0,1,1" />
  194. </ThicknessAnimationUsingKeyFrames>
  195. </Storyboard>
  196. </VisualState>
  197. <VisualState x:Name="HiddenState">
  198. <Storyboard>
  199. <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
  200. Storyboard.TargetProperty="BorderThickness"
  201. Storyboard.TargetName="PART_HeaderCellBorder">
  202. <EasingThicknessKeyFrame KeyTime="0" Value="3,0,3,1" />
  203. </ThicknessAnimationUsingKeyFrames>
  204. </Storyboard>
  205. </VisualState>
  206. <VisualState x:Name="NormalState" />
  207. <VisualState x:Name="LastColumnHidden">
  208. <Storyboard>
  209. <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
  210. Storyboard.TargetProperty="BorderThickness"
  211. Storyboard.TargetName="PART_HeaderCellBorder">
  212. <EasingThicknessKeyFrame KeyTime="0" Value="0,0,3,1" />
  213. </ThicknessAnimationUsingKeyFrames>
  214. </Storyboard>
  215. </VisualState>
  216. </VisualStateGroup>
  217. <VisualStateGroup x:Name="CommonStates">
  218. <VisualState x:Name="MouseOver" />
  219. <VisualState x:Name="Normal" />
  220. </VisualStateGroup>
  221. <VisualStateGroup x:Name="BorderStates">
  222. <VisualState x:Name="NormalCell" />
  223. <VisualState x:Name="FooterColumnCell">
  224. <Storyboard BeginTime="0">
  225. <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
  226. Storyboard.TargetProperty="BorderThickness"
  227. Storyboard.TargetName="PART_FooterCellBorder">
  228. <EasingThicknessKeyFrame KeyTime="0" Value="1,0,1,1" />
  229. </ThicknessAnimationUsingKeyFrames>
  230. </Storyboard>
  231. </VisualState>
  232. <VisualState x:Name="BeforeFooterColumnCell">
  233. <Storyboard BeginTime="0">
  234. <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
  235. Storyboard.TargetProperty="BorderThickness"
  236. Storyboard.TargetName="PART_FooterCellBorder">
  237. <EasingThicknessKeyFrame KeyTime="0" Value="0,0,0,1" />
  238. </ThicknessAnimationUsingKeyFrames>
  239. <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
  240. Storyboard.TargetProperty="BorderThickness"
  241. Storyboard.TargetName="PART_HeaderCellBorder">
  242. <EasingThicknessKeyFrame KeyTime="0" Value="0,0,0,1" />
  243. </ThicknessAnimationUsingKeyFrames>
  244. </Storyboard>
  245. </VisualState>
  246. </VisualStateGroup>
  247. </VisualStateManager.VisualStateGroups>
  248. <Border x:Name="PART_FooterCellBorder" BorderBrush="{TemplateBinding BorderBrush}"
  249. Background="{TemplateBinding Background}" />
  250. <Border x:Name="PART_HeaderCellBorder" BorderBrush="{TemplateBinding BorderBrush}"
  251. BorderThickness="{TemplateBinding BorderThickness}"
  252. Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
  253. <Grid Margin="{TemplateBinding Padding}" SnapsToDevicePixels="True">
  254. <Grid.ColumnDefinitions>
  255. <ColumnDefinition Width="*" />
  256. <ColumnDefinition Width="Auto" />
  257. <ColumnDefinition Width="Auto" />
  258. </Grid.ColumnDefinitions>
  259. <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}"
  260. Content="{TemplateBinding Content}"
  261. ContentStringFormat="{TemplateBinding ContentStringFormat}"
  262. Focusable="False"
  263. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  264. VerticalAlignment="Center" />
  265. <Grid x:Name="PART_SortButtonPresenter" Grid.Column="1" SnapsToDevicePixels="True">
  266. <Grid.ColumnDefinitions>
  267. <ColumnDefinition Width="*">
  268. <ColumnDefinition.MinWidth>
  269. <Binding Mode="OneWay" Path="SortDirection"
  270. RelativeSource="{RelativeSource TemplatedParent}">
  271. <Binding.Converter>
  272. <syncfusion:SortDirectionToWidthConverter />
  273. </Binding.Converter>
  274. </Binding>
  275. </ColumnDefinition.MinWidth>
  276. </ColumnDefinition>
  277. <ColumnDefinition Width="*" />
  278. </Grid.ColumnDefinitions>
  279. <Path
  280. Data="F1M753.644,-13.0589L753.736,-12.9639 753.557,-12.7816 732.137,8.63641 732.137,29.7119 756.445,5.40851 764.094,-2.24384 764.275,-2.42352 771.834,5.1286 796.137,29.4372 796.137,8.36163 774.722,-13.0589 764.181,-23.5967 753.644,-13.0589z"
  281. Fill="Gray" HorizontalAlignment="Center" Height="8.138" Stretch="Fill"
  282. SnapsToDevicePixels="True" VerticalAlignment="Center" Width="8.938">
  283. <Path.RenderTransform>
  284. <TransformGroup>
  285. <RotateTransform Angle="90" />
  286. <ScaleTransform ScaleY="1" ScaleX="1" />
  287. </TransformGroup>
  288. </Path.RenderTransform>
  289. <!-- <Path.Visibility> -->
  290. <!-- <Binding ConverterParameter="Ascending" Path="SortDirection" RelativeSource="{RelativeSource TemplatedParent}"> -->
  291. <!-- <Binding.Converter> -->
  292. <!-- <syncfusion:SortDirectionToVisibilityConverter/> -->
  293. <!-- </Binding.Converter> -->
  294. <!-- </Binding> -->
  295. <!-- </Path.Visibility> -->
  296. </Path>
  297. <Path
  298. Data="F1M181.297,177.841L181.205,177.746 181.385,177.563 202.804,156.146 202.804,135.07 178.497,159.373 170.847,167.026 170.666,167.205 163.107,159.653 138.804,135.345 138.804,156.42 160.219,177.841 170.76,188.379 181.297,177.841z"
  299. Fill="Gray" HorizontalAlignment="Center" Height="8.138" Stretch="Fill"
  300. SnapsToDevicePixels="True" VerticalAlignment="Center" Width="8.938">
  301. <Path.RenderTransform>
  302. <TransformGroup>
  303. <RotateTransform Angle="90" />
  304. <ScaleTransform ScaleY="1" ScaleX="1" />
  305. </TransformGroup>
  306. </Path.RenderTransform>
  307. <!-- <Path.Visibility> -->
  308. <!-- <Binding ConverterParameter="Decending" Path="SortDirection" RelativeSource="{RelativeSource TemplatedParent}"> -->
  309. <!-- <Binding.Converter> -->
  310. <!-- <syncfusion:SortDirectionToVisibilityConverter/> -->
  311. <!-- </Binding.Converter> -->
  312. <!-- </Binding> -->
  313. <!-- </Path.Visibility> -->
  314. </Path>
  315. <TextBlock Grid.Column="1" Foreground="{TemplateBinding Foreground}" FontSize="10"
  316. Margin="0,-4,0,0" SnapsToDevicePixels="True"
  317. Text="{TemplateBinding SortNumber}"
  318. Visibility="{TemplateBinding SortNumberVisibility}"
  319. VerticalAlignment="Center" />
  320. </Grid>
  321. <syncfusion:FilterToggleButton x:Name="PART_FilterToggleButton" Grid.Column="2"
  322. HorizontalAlignment="Stretch" SnapsToDevicePixels="True"
  323. Visibility="{TemplateBinding FilterIconVisiblity}"
  324. VerticalAlignment="Stretch" />
  325. <Border x:Name="PART_FilterPopUpPresenter" />
  326. </Grid>
  327. </Border>
  328. </Grid>
  329. </ControlTemplate>
  330. </Setter.Value>
  331. </Setter>
  332. </Style>
  333. <Style BasedOn="{StaticResource {x:Type TabItem}}" TargetType="{x:Type local:DynamicTabItem}">
  334. <Setter Property="Template">
  335. <Setter.Value>
  336. <ControlTemplate TargetType="{x:Type local:DynamicTabItem}">
  337. <Border Name="Panel" BorderBrush="Gray" PreviewMouseRightButtonUp="Panel_OnPreviewMouseRightButtonUp">
  338. <DockPanel>
  339. <Button x:Name="CloseButton" DockPanel.Dock="Right" Content="x" BorderThickness="0"
  340. Padding="5,0,5,0" Background="Transparent" VerticalContentAlignment="Center"
  341. HorizontalContentAlignment="Center"
  342. IsEnabled="True" Margin="2"
  343. Command="{TemplateBinding CloseTabCommand}" />
  344. <ContentPresenter
  345. x:Name="ContentSite"
  346. DockPanel.Dock="Left"
  347. VerticalAlignment="Center"
  348. HorizontalAlignment="Center"
  349. ContentSource="Header"
  350. Margin="10,3.5" />
  351. </DockPanel>
  352. </Border>
  353. <ControlTemplate.Triggers>
  354. <Trigger Property="IsSelected" Value="True">
  355. <Setter TargetName="Panel" Property="Background"
  356. Value="{Binding Path=(themes:ThemeManager.SelectedTabItemBackgroundBrush)}" />
  357. <Setter TargetName="Panel" Property="TextBlock.Foreground"
  358. Value="{Binding Path=(themes:ThemeManager.SelectedTabItemForegroundBrush)}" />
  359. </Trigger>
  360. <Trigger Property="IsSelected" Value="False">
  361. <Setter TargetName="Panel" Property="Background"
  362. Value="{Binding Path=(themes:ThemeManager.WorkspaceBackgroundBrush)}" />
  363. <Setter TargetName="Panel" Property="TextBlock.Foreground"
  364. Value="{Binding Path=(themes:ThemeManager.WorkspaceForegroundBrush)}" />
  365. </Trigger>
  366. <Trigger Property="CanClose" Value="True">
  367. <Setter TargetName="CloseButton" Property="Visibility" Value="Visible" />
  368. </Trigger>
  369. <Trigger Property="CanClose" Value="False">
  370. <Setter TargetName="CloseButton" Property="Visibility" Value="Collapsed" />
  371. </Trigger>
  372. <Trigger Property="TabStripPlacement" Value="{x:Static Dock.Bottom}">
  373. <Setter TargetName="Panel" Property="CornerRadius" Value="0,0,5,5" />
  374. <Setter TargetName="Panel" Property="Margin" Value="0,-0.75,2,2" />
  375. <Setter TargetName="Panel" Property="BorderThickness" Value="0.75,0,0.75,0.75" />
  376. </Trigger>
  377. <Trigger Property="TabStripPlacement" Value="{x:Static Dock.Top}">
  378. <Setter TargetName="Panel" Property="CornerRadius" Value="5,5,0,0" />
  379. <Setter TargetName="Panel" Property="Margin" Value="0,2,2,0.75" />
  380. <Setter TargetName="Panel" Property="BorderThickness" Value="0.75,0.75,0.75,0" />
  381. </Trigger>
  382. </ControlTemplate.Triggers>
  383. </ControlTemplate>
  384. </Setter.Value>
  385. </Setter>
  386. </Style>
  387. <!-- ~1~ This template explains how to render a tab item with a close button. @1@ -->
  388. <!-- <DataTemplate x:Key="ClosableTabItemHeader"> -->
  389. <!-- <DockPanel MinWidth="120"> -->
  390. <!-- <Button DockPanel.Dock="Right" Command="ApplicationCommands.Delete" CommandParameter="{Binding}" Content="X" Cursor="Hand" Focusable="False" FontSize="10" FontWeight="Bold" Height="16" Width="16" /> -->
  391. <!-- <TextBlock Padding="0,0,10,0" Text="{Binding DisplayName}" VerticalAlignment="Center" /> -->
  392. <!-- </DockPanel> -->
  393. <!-- </DataTemplate> -->
  394. <!-- ~1~ This template explains how to render a tab item with a new button. @1@ -->
  395. <!-- <DataTemplate x:Key="NewTabItemHeader"> -->
  396. <!-- <Button Command="{Binding NewTabCommand, RelativeSource={RelativeSource AncestorType={x:Type local:DynamicTabControl}}}" Content="+" Cursor="Hand" Focusable="False" FontWeight="Bold" -->
  397. <!-- Width="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"/> -->
  398. <!-- </DataTemplate> -->
  399. <Style BasedOn="{StaticResource {x:Type TabControl}}" TargetType="{x:Type local:DynamicTabControl}">
  400. <Setter Property="Template">
  401. <Setter.Value>
  402. <ControlTemplate TargetType="{x:Type local:DynamicTabControl}">
  403. <Grid Background="Transparent">
  404. <Grid.RowDefinitions>
  405. <RowDefinition Height="Auto" />
  406. <RowDefinition Height="*" />
  407. <RowDefinition Height="Auto" />
  408. </Grid.RowDefinitions>
  409. <DockPanel x:Name="Panel"
  410. Background="{Binding Path=(themes:ThemeManager.WorkspaceBackgroundBrush)}">
  411. <Button x:Name="AddButton" DockPanel.Dock="Right" Content="+"
  412. BorderThickness="0" Padding="5,0,5,0" Background="Transparent"
  413. Command="{TemplateBinding CreateTabCommand}" />
  414. <TabPanel IsItemsHost="true" Background="Transparent" />
  415. </DockPanel>
  416. <Border
  417. x:Name="Content"
  418. Grid.Row="1"
  419. BorderBrush="Gray"
  420. Background="{Binding Path=(themes:ThemeManager.WorkspaceBackgroundBrush)}"
  421. BorderThickness="0.75">
  422. <ContentPresenter ContentSource="SelectedContent" />
  423. </Border>
  424. </Grid>
  425. <ControlTemplate.Triggers>
  426. <Trigger Property="CanCreateTab" Value="True">
  427. <Setter TargetName="AddButton" Property="Visibility" Value="Visible" />
  428. </Trigger>
  429. <Trigger Property="CanCreateTab" Value="False">
  430. <Setter TargetName="AddButton" Property="Visibility" Value="Collapsed" />
  431. </Trigger>
  432. <Trigger Property="TabStripPlacement" Value="{x:Static Dock.Top}">
  433. <Setter TargetName="Panel" Property="Grid.Row" Value="0" />
  434. <Setter TargetName="Content" Property="BorderThickness" Value="0,0.75,0,0" />
  435. <Setter TargetName="Content" Property="Padding" Value="0,2,0,0" />
  436. </Trigger>
  437. <Trigger Property="TabStripPlacement" Value="{x:Static Dock.Bottom}">
  438. <Setter TargetName="Panel" Property="Grid.Row" Value="2" />
  439. <Setter TargetName="Content" Property="BorderThickness" Value="0,0,0,0.75" />
  440. <Setter TargetName="Content" Property="Padding" Value="0,0,0,3" />
  441. </Trigger>
  442. </ControlTemplate.Triggers>
  443. </ControlTemplate>
  444. </Setter.Value>
  445. </Setter>
  446. </Style>
  447. </ResourceDictionary>