Generic.xaml 48 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729
  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:wpf="clr-namespace:InABox.Wpf"
  6. xmlns:syncfusion="http://schemas.syncfusion.com/wpf"
  7. xmlns:themes="clr-namespace:InABox.WPF.Themes"
  8. x:Class="InABox.WPF.Generic"
  9. x:ClassModifier="public">
  10. <!-- VerticalSplitter -->
  11. <ControlTemplate x:Key="VerticalSplitter">
  12. <Grid Background="{TemplateBinding Background}" Width="4">
  13. <Button x:Name="PART_Left" Visibility="Collapsed" />
  14. <Button x:Name="PART_Right" Visibility="Collapsed" />
  15. <StackPanel Margin="0" Orientation="Vertical" VerticalAlignment="Center" HorizontalAlignment="Center">
  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. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="0,2,0,0" />
  23. </StackPanel>
  24. </Grid>
  25. </ControlTemplate>
  26. <!-- HorizontalSplitter -->
  27. <ControlTemplate x:Key="HorizontalSplitter">
  28. <Grid Background="{TemplateBinding Background}" Height="4">
  29. <Button x:Name="PART_Left" Visibility="Collapsed" />
  30. <Button x:Name="PART_Right" Visibility="Collapsed" />
  31. <StackPanel Margin="0" Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
  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. <Ellipse Fill="Silver" HorizontalAlignment="Center" Height="2" Width="2" Opacity="1" Margin="2,0,0,0" />
  39. </StackPanel>
  40. </Grid>
  41. </ControlTemplate>
  42. <Style TargetType="wpf:ZoomPanel">
  43. <Setter Property="Template">
  44. <Setter.Value>
  45. <ControlTemplate TargetType="wpf:ZoomPanel">
  46. <ControlTemplate.Resources>
  47. <wpf:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter"/>
  48. </ControlTemplate.Resources>
  49. <Grid>
  50. <Grid.RowDefinitions>
  51. <RowDefinition Height="*"/>
  52. <RowDefinition Height="Auto"/>
  53. </Grid.RowDefinitions>
  54. <ScrollViewer Grid.Row="0"
  55. Background="{TemplateBinding Background}"
  56. x:Name="PART_Scroll"
  57. HorizontalScrollBarVisibility="Auto"
  58. VerticalScrollBarVisibility="Auto">
  59. <Border Background="Transparent" x:Name="PART_ContentBorder">
  60. <ContentControl x:Name="PART_ZoomContent" VerticalAlignment="Center" Content="{TemplateBinding Content}">
  61. <ContentControl.LayoutTransform>
  62. <ScaleTransform ScaleX="{Binding Scale,RelativeSource={RelativeSource TemplatedParent}}"
  63. ScaleY="{Binding Scale,RelativeSource={RelativeSource TemplatedParent}}"/>
  64. </ContentControl.LayoutTransform>
  65. </ContentControl>
  66. </Border>
  67. </ScrollViewer>
  68. <DockPanel Grid.Row="1" LastChildFill="False"
  69. Visibility="{Binding ShowNavigationButtons,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource BoolToVisibilityConverter}}">
  70. <Button x:Name="PART_ZoomInButton" Margin="5">
  71. <Image Source="pack://application:,,,/InABox.Wpf;component/Resources/zoomin.png" Width="32" Height="32"/>
  72. </Button>
  73. <Button x:Name="PART_ZoomOutButton" Margin="0,5,5,5">
  74. <Image Source="pack://application:,,,/InABox.Wpf;component/Resources/zoomout.png" Width="32" Height="32"/>
  75. </Button>
  76. <Button x:Name="PART_LeftButton" Margin="0,5,5,5">
  77. <Image Source="pack://application:,,,/InABox.Wpf;component/Resources/leftarrow.png" Width="32" Height="32"/>
  78. </Button>
  79. <Button x:Name="PART_RightButton" Margin="0,5,5,5">
  80. <Image Source="pack://application:,,,/InABox.Wpf;component/Resources/rightarrow.png" Width="32" Height="32"/>
  81. </Button>
  82. <Button x:Name="PART_UpButton" Margin="0,5,5,5">
  83. <Image Source="pack://application:,,,/InABox.Wpf;component/Resources/uparrow.png" Width="32" Height="32"/>
  84. </Button>
  85. <Button x:Name="PART_DownButton" Margin="0,5,5,5">
  86. <Image Source="pack://application:,,,/InABox.Wpf;component/Resources/downarrow.png" Width="32" Height="32"/>
  87. </Button>
  88. </DockPanel>
  89. </Grid>
  90. </ControlTemplate>
  91. </Setter.Value>
  92. </Setter>
  93. </Style>
  94. <!-- DynamicSplitPanel -->
  95. <Style TargetType="{x:Type local:DynamicSplitPanel}">
  96. <Setter Property="Template">
  97. <Setter.Value>
  98. <ControlTemplate TargetType="{x:Type local:DynamicSplitPanel}">
  99. <Grid x:Name="PART_Grid">
  100. <Grid.ColumnDefinitions>
  101. <ColumnDefinition Width="0" />
  102. <ColumnDefinition Width="Auto" />
  103. <ColumnDefinition Width="Auto" />
  104. <ColumnDefinition Width="*" />
  105. <ColumnDefinition Width="0" />
  106. </Grid.ColumnDefinitions>
  107. <Grid.RowDefinitions>
  108. <RowDefinition Height="Auto" />
  109. <RowDefinition Height="*" />
  110. </Grid.RowDefinitions>
  111. <DockPanel Grid.Row="0" Grid.Column="0" Grid.RowSpan="2" Margin="0,0,2,0">
  112. <Button DockPanel.Dock="Top" x:Name="PART_DetailsOnly" BorderBrush="Gray"
  113. BorderThickness="0.75,0.75,0.75,0" Margin="0" Background="WhiteSmoke" MinHeight="25"
  114. Width="25" Focusable="False" >
  115. <Polygon Points="0,0 8,5, 0,10" Stroke="Gray" Fill="Silver" />
  116. </Button>
  117. <Border DockPanel.Dock="Top" BorderBrush="Gray" BorderThickness="0.75,0,0.75,0.75" Margin="0,0,0,0"
  118. Background="WhiteSmoke" Width="25">
  119. <Label x:Name="PART_MasterHeader"
  120. Content="{Binding MasterCaption, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}"
  121. HorizontalContentAlignment="Right">
  122. <Label.LayoutTransform>
  123. <RotateTransform Angle="270" />
  124. </Label.LayoutTransform>
  125. </Label>
  126. </Border>
  127. </DockPanel>
  128. <DockPanel Grid.Row="0" Grid.Column="1">
  129. <Button x:Name="PART_CombinedRight" BorderBrush="Gray" BorderThickness="0.75"
  130. Margin="2,0,0,2" Background="WhiteSmoke" DockPanel.Dock="Right" MinWidth="25"
  131. MinHeight="25" HorizontalContentAlignment="Center"
  132. VerticalContentAlignment="Center" Focusable="False">
  133. <Polygon Points="0,0 8,5, 0,10" Stroke="Gray" Fill="Silver" />
  134. </Button>
  135. <Button x:Name="PART_CombinedLeft" BorderBrush="Gray" BorderThickness="0.75"
  136. Margin="2,0,0,2" Background="WhiteSmoke" DockPanel.Dock="Right" MinWidth="25"
  137. MinHeight="25" Focusable="False">
  138. <Polygon Points="8,0 0,5, 8,10" Stroke="Gray" Fill="Silver" />
  139. </Button>
  140. <ContentPresenter DockPanel.Dock="Left" MinHeight="25" Margin="0,0,0,2"
  141. Content="{Binding Header, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}" />
  142. </DockPanel>
  143. <ContentPresenter Grid.Row="1" Grid.Column="1"
  144. Content="{Binding Master, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}" />
  145. <syncfusion:SfGridSplitter Grid.Row="0" Grid.RowSpan="2" Grid.Column="2" Name="PART_Splitter"
  146. ResizeBehavior="PreviousAndNext" Width="4" Background="Transparent"
  147. Template="{StaticResource VerticalSplitter}">
  148. <syncfusion:SfGridSplitter.PreviewStyle>
  149. <Style TargetType="Control">
  150. <Setter Property="Background" Value="Gray" />
  151. <Setter Property="Template">
  152. <Setter.Value>
  153. <ControlTemplate TargetType="Control">
  154. <Grid x:Name="Root" Opacity="0.5">
  155. <Rectangle Fill="{TemplateBinding Background}" />
  156. </Grid>
  157. </ControlTemplate>
  158. </Setter.Value>
  159. </Setter>
  160. </Style>
  161. </syncfusion:SfGridSplitter.PreviewStyle>
  162. </syncfusion:SfGridSplitter>
  163. <ContentPresenter Grid.Row="0" Grid.Column="3" Margin="0,0,0,2"
  164. Content="{Binding DetailHeader, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}" />
  165. <Grid x:Name="PART_DetailGrid" Grid.Row="1" Grid.Column="3">
  166. <Grid.RowDefinitions>
  167. <RowDefinition Height="*" />
  168. <RowDefinition Height="Auto" />
  169. <RowDefinition Height="*" />
  170. </Grid.RowDefinitions>
  171. <ContentPresenter Grid.Row="0"
  172. Content="{Binding Detail, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}" />
  173. <syncfusion:SfGridSplitter Grid.Row="1" Name="PART_DetailSplitter"
  174. ResizeBehavior="PreviousAndNext" Height="4"
  175. HorizontalAlignment="Stretch" Background="Transparent"
  176. Template="{StaticResource HorizontalSplitter}">
  177. <syncfusion:SfGridSplitter.PreviewStyle>
  178. <Style TargetType="Control">
  179. <Setter Property="Background" Value="Gray" />
  180. <Setter Property="Template">
  181. <Setter.Value>
  182. <ControlTemplate TargetType="Control">
  183. <Grid x:Name="Root" Opacity="0.5">
  184. <Rectangle Fill="{TemplateBinding Background}" />
  185. </Grid>
  186. </ControlTemplate>
  187. </Setter.Value>
  188. </Setter>
  189. </Style>
  190. </syncfusion:SfGridSplitter.PreviewStyle>
  191. </syncfusion:SfGridSplitter>
  192. <ContentPresenter Grid.Row="2"
  193. Content="{Binding SecondaryDetail, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}" />
  194. </Grid>
  195. <DockPanel Grid.Row="0" Grid.Column="4" Grid.RowSpan="2" Margin="2,0,0,0">
  196. <Button DockPanel.Dock="Top" x:Name="PART_MasterOnly" BorderBrush="Gray"
  197. BorderThickness="0.75,0.75,0.75,0" Margin="0" Background="WhiteSmoke" MinHeight="25"
  198. MinWidth="25" Focusable="False">
  199. <Polygon Points="8,0 0,5, 8,10" Stroke="Gray" Fill="Silver" />
  200. </Button>
  201. <Border DockPanel.Dock="Top" BorderBrush="Gray" BorderThickness="0.75,0,0.75,0.75"
  202. Background="WhiteSmoke">
  203. <Label x:Name="PART_DetailHeader"
  204. Content="{Binding DetailCaption, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=local:DynamicSplitPanel}}"
  205. HorizontalContentAlignment="Right">
  206. <Label.LayoutTransform>
  207. <RotateTransform Angle="270" />
  208. </Label.LayoutTransform>
  209. </Label>
  210. </Border>
  211. </DockPanel>
  212. </Grid>
  213. </ControlTemplate>
  214. </Setter.Value>
  215. </Setter>
  216. </Style>
  217. <Style TargetType="syncfusion:GridFilterControl">
  218. <Setter Property="SortOptionVisibility" Value="Collapsed" />
  219. </Style>
  220. <!-- VerticalColumnHeader -->
  221. <Style x:Key="ActionColumnHeader" TargetType="{x:Type syncfusion:GridHeaderCellControl}">
  222. <Setter Property="Background" Value="LightSkyBlue" />
  223. <Setter Property="Foreground" Value="Black" />
  224. <Setter Property="BorderBrush" Value="Black" />
  225. <Setter Property="BorderThickness" Value="0.5,0.5,0.5,0.5" />
  226. <Setter Property="HorizontalContentAlignment" Value="Left" />
  227. <Setter Property="Padding" Value="5,3" />
  228. <Setter Property="FontFamily" Value="Segoe UI" />
  229. <Setter Property="FontSize" Value="14" />
  230. <Setter Property="FontWeight" Value="Normal" />
  231. <Setter Property="IsTabStop" Value="False" />
  232. <Setter Property="Template">
  233. <Setter.Value>
  234. <ControlTemplate TargetType="{x:Type syncfusion:GridHeaderCellControl}">
  235. <Grid>
  236. <Grid.LayoutTransform>
  237. <RotateTransform Angle="90" />
  238. </Grid.LayoutTransform>
  239. <VisualStateManager.VisualStateGroups>
  240. <VisualStateGroup x:Name="HiddenColumnsResizingStates">
  241. <VisualState x:Name="PreviousColumnHidden">
  242. <Storyboard>
  243. <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
  244. Storyboard.TargetProperty="BorderThickness"
  245. Storyboard.TargetName="PART_HeaderCellBorder">
  246. <EasingThicknessKeyFrame KeyTime="0" Value="3,0,1,1" />
  247. </ThicknessAnimationUsingKeyFrames>
  248. </Storyboard>
  249. </VisualState>
  250. <VisualState x:Name="HiddenState">
  251. <Storyboard>
  252. <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
  253. Storyboard.TargetProperty="BorderThickness"
  254. Storyboard.TargetName="PART_HeaderCellBorder">
  255. <EasingThicknessKeyFrame KeyTime="0" Value="3,0,3,1" />
  256. </ThicknessAnimationUsingKeyFrames>
  257. </Storyboard>
  258. </VisualState>
  259. <VisualState x:Name="NormalState" />
  260. <VisualState x:Name="LastColumnHidden">
  261. <Storyboard>
  262. <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
  263. Storyboard.TargetProperty="BorderThickness"
  264. Storyboard.TargetName="PART_HeaderCellBorder">
  265. <EasingThicknessKeyFrame KeyTime="0" Value="0,0,3,1" />
  266. </ThicknessAnimationUsingKeyFrames>
  267. </Storyboard>
  268. </VisualState>
  269. </VisualStateGroup>
  270. <VisualStateGroup x:Name="CommonStates">
  271. <VisualState x:Name="MouseOver" />
  272. <VisualState x:Name="Normal" />
  273. </VisualStateGroup>
  274. <VisualStateGroup x:Name="BorderStates">
  275. <VisualState x:Name="NormalCell" />
  276. <VisualState x:Name="FooterColumnCell">
  277. <Storyboard BeginTime="0">
  278. <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
  279. Storyboard.TargetProperty="BorderThickness"
  280. Storyboard.TargetName="PART_FooterCellBorder">
  281. <EasingThicknessKeyFrame KeyTime="0" Value="1,0,1,1" />
  282. </ThicknessAnimationUsingKeyFrames>
  283. </Storyboard>
  284. </VisualState>
  285. <VisualState x:Name="BeforeFooterColumnCell">
  286. <Storyboard BeginTime="0">
  287. <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
  288. Storyboard.TargetProperty="BorderThickness"
  289. Storyboard.TargetName="PART_FooterCellBorder">
  290. <EasingThicknessKeyFrame KeyTime="0" Value="0,0,0,1" />
  291. </ThicknessAnimationUsingKeyFrames>
  292. <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
  293. Storyboard.TargetProperty="BorderThickness"
  294. Storyboard.TargetName="PART_HeaderCellBorder">
  295. <EasingThicknessKeyFrame KeyTime="0" Value="0,0,0,1" />
  296. </ThicknessAnimationUsingKeyFrames>
  297. </Storyboard>
  298. </VisualState>
  299. </VisualStateGroup>
  300. </VisualStateManager.VisualStateGroups>
  301. <Border x:Name="PART_FooterCellBorder" BorderBrush="{TemplateBinding BorderBrush}"
  302. Background="{TemplateBinding Background}" />
  303. <Border x:Name="PART_HeaderCellBorder" BorderBrush="{TemplateBinding BorderBrush}"
  304. BorderThickness="{TemplateBinding BorderThickness}"
  305. Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
  306. <Grid Margin="{TemplateBinding Padding}" SnapsToDevicePixels="True">
  307. <Grid.ColumnDefinitions>
  308. <ColumnDefinition Width="*" />
  309. <ColumnDefinition Width="Auto" />
  310. <ColumnDefinition Width="Auto" />
  311. </Grid.ColumnDefinitions>
  312. <ContentPresenter ContentTemplate="{TemplateBinding ContentTemplate}"
  313. Content="{TemplateBinding Content}"
  314. ContentStringFormat="{TemplateBinding ContentStringFormat}"
  315. Focusable="False"
  316. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  317. VerticalAlignment="Center" />
  318. <Grid x:Name="PART_SortButtonPresenter" Grid.Column="1" SnapsToDevicePixels="True">
  319. <Grid.ColumnDefinitions>
  320. <ColumnDefinition Width="*">
  321. <ColumnDefinition.MinWidth>
  322. <Binding Mode="OneWay" Path="SortDirection"
  323. RelativeSource="{RelativeSource TemplatedParent}">
  324. <Binding.Converter>
  325. <syncfusion:SortDirectionToWidthConverter />
  326. </Binding.Converter>
  327. </Binding>
  328. </ColumnDefinition.MinWidth>
  329. </ColumnDefinition>
  330. <ColumnDefinition Width="*" />
  331. </Grid.ColumnDefinitions>
  332. <Path
  333. 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"
  334. Fill="Gray" HorizontalAlignment="Center" Height="8.138" Stretch="Fill"
  335. SnapsToDevicePixels="True" VerticalAlignment="Center" Width="8.938">
  336. <Path.RenderTransform>
  337. <TransformGroup>
  338. <RotateTransform Angle="90" />
  339. <ScaleTransform ScaleY="1" ScaleX="1" />
  340. </TransformGroup>
  341. </Path.RenderTransform>
  342. <!-- <Path.Visibility> -->
  343. <!-- <Binding ConverterParameter="Ascending" Path="SortDirection" RelativeSource="{RelativeSource TemplatedParent}"> -->
  344. <!-- <Binding.Converter> -->
  345. <!-- <syncfusion:SortDirectionToVisibilityConverter/> -->
  346. <!-- </Binding.Converter> -->
  347. <!-- </Binding> -->
  348. <!-- </Path.Visibility> -->
  349. </Path>
  350. <Path
  351. 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"
  352. Fill="Gray" HorizontalAlignment="Center" Height="8.138" Stretch="Fill"
  353. SnapsToDevicePixels="True" VerticalAlignment="Center" Width="8.938">
  354. <Path.RenderTransform>
  355. <TransformGroup>
  356. <RotateTransform Angle="90" />
  357. <ScaleTransform ScaleY="1" ScaleX="1" />
  358. </TransformGroup>
  359. </Path.RenderTransform>
  360. <!-- <Path.Visibility> -->
  361. <!-- <Binding ConverterParameter="Decending" Path="SortDirection" RelativeSource="{RelativeSource TemplatedParent}"> -->
  362. <!-- <Binding.Converter> -->
  363. <!-- <syncfusion:SortDirectionToVisibilityConverter/> -->
  364. <!-- </Binding.Converter> -->
  365. <!-- </Binding> -->
  366. <!-- </Path.Visibility> -->
  367. </Path>
  368. <TextBlock Grid.Column="1" Foreground="{TemplateBinding Foreground}" FontSize="10"
  369. Margin="0,-4,0,0" SnapsToDevicePixels="True"
  370. Text="{TemplateBinding SortNumber}"
  371. Visibility="{TemplateBinding SortNumberVisibility}"
  372. VerticalAlignment="Center" />
  373. </Grid>
  374. <syncfusion:FilterToggleButton x:Name="PART_FilterToggleButton" Grid.Column="2"
  375. HorizontalAlignment="Stretch" SnapsToDevicePixels="True"
  376. Visibility="{TemplateBinding FilterIconVisiblity}"
  377. VerticalAlignment="Stretch" />
  378. <Border x:Name="PART_FilterPopUpPresenter" />
  379. </Grid>
  380. </Border>
  381. </Grid>
  382. </ControlTemplate>
  383. </Setter.Value>
  384. </Setter>
  385. </Style>
  386. <ControlTemplate x:Key="VerticalColumnHeader"
  387. TargetType="{x:Type syncfusion:GridHeaderCellControl}">
  388. <Grid>
  389. <Grid.LayoutTransform>
  390. <RotateTransform Angle="270" />
  391. </Grid.LayoutTransform>
  392. <VisualStateManager.VisualStateGroups>
  393. <VisualStateGroup x:Name="HiddenColumnsResizingStates">
  394. <VisualState x:Name="PreviousColumnHidden">
  395. <Storyboard>
  396. <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
  397. Storyboard.TargetProperty="BorderThickness"
  398. Storyboard.TargetName="PART_HeaderCellBorder">
  399. <EasingThicknessKeyFrame KeyTime="0" Value="3,0,1,1" />
  400. </ThicknessAnimationUsingKeyFrames>
  401. </Storyboard>
  402. </VisualState>
  403. <VisualState x:Name="HiddenState">
  404. <Storyboard>
  405. <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
  406. Storyboard.TargetProperty="BorderThickness"
  407. Storyboard.TargetName="PART_HeaderCellBorder">
  408. <EasingThicknessKeyFrame KeyTime="0" Value="3,0,3,1" />
  409. </ThicknessAnimationUsingKeyFrames>
  410. </Storyboard>
  411. </VisualState>
  412. <VisualState x:Name="NormalState" />
  413. <VisualState x:Name="LastColumnHidden">
  414. <Storyboard>
  415. <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
  416. Storyboard.TargetProperty="BorderThickness"
  417. Storyboard.TargetName="PART_HeaderCellBorder">
  418. <EasingThicknessKeyFrame KeyTime="0" Value="0,0,3,1" />
  419. </ThicknessAnimationUsingKeyFrames>
  420. </Storyboard>
  421. </VisualState>
  422. </VisualStateGroup>
  423. <VisualStateGroup x:Name="CommonStates">
  424. <VisualState x:Name="MouseOver" />
  425. <VisualState x:Name="Normal" />
  426. </VisualStateGroup>
  427. <VisualStateGroup x:Name="BorderStates">
  428. <VisualState x:Name="NormalCell" />
  429. <VisualState x:Name="FooterColumnCell">
  430. <Storyboard BeginTime="0">
  431. <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
  432. Storyboard.TargetProperty="BorderThickness"
  433. Storyboard.TargetName="PART_FooterCellBorder">
  434. <EasingThicknessKeyFrame KeyTime="0" Value="1,0,1,1" />
  435. </ThicknessAnimationUsingKeyFrames>
  436. </Storyboard>
  437. </VisualState>
  438. <VisualState x:Name="BeforeFooterColumnCell">
  439. <Storyboard BeginTime="0">
  440. <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
  441. Storyboard.TargetProperty="BorderThickness"
  442. Storyboard.TargetName="PART_FooterCellBorder">
  443. <EasingThicknessKeyFrame KeyTime="0" Value="0,0,0,1" />
  444. </ThicknessAnimationUsingKeyFrames>
  445. <ThicknessAnimationUsingKeyFrames BeginTime="0" Duration="1.0:0:0"
  446. Storyboard.TargetProperty="BorderThickness"
  447. Storyboard.TargetName="PART_HeaderCellBorder">
  448. <EasingThicknessKeyFrame KeyTime="0" Value="0,0,0,1" />
  449. </ThicknessAnimationUsingKeyFrames>
  450. </Storyboard>
  451. </VisualState>
  452. </VisualStateGroup>
  453. </VisualStateManager.VisualStateGroups>
  454. <Border x:Name="PART_FooterCellBorder" BorderBrush="{TemplateBinding BorderBrush}"
  455. Background="{TemplateBinding Background}" />
  456. <Border x:Name="PART_HeaderCellBorder" BorderBrush="{TemplateBinding BorderBrush}"
  457. BorderThickness="{TemplateBinding BorderThickness}"
  458. Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
  459. <Grid Margin="{TemplateBinding Padding}" SnapsToDevicePixels="True">
  460. <Grid.ColumnDefinitions>
  461. <ColumnDefinition Width="*" />
  462. <ColumnDefinition Width="Auto" />
  463. <ColumnDefinition Width="Auto" />
  464. </Grid.ColumnDefinitions>
  465. <ContentPresenter
  466. ContentTemplate="{TemplateBinding ContentTemplate}"
  467. ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False"
  468. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  469. VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
  470. <ContentPresenter.Content>
  471. <TextBlock Text="{Binding HeaderText}" TextWrapping="Wrap" />
  472. </ContentPresenter.Content>
  473. </ContentPresenter>
  474. <Grid x:Name="PART_SortButtonPresenter" Grid.Column="1" SnapsToDevicePixels="True">
  475. <Grid.ColumnDefinitions>
  476. <ColumnDefinition Width="*">
  477. <ColumnDefinition.MinWidth>
  478. <Binding Mode="OneWay" Path="SortDirection"
  479. RelativeSource="{RelativeSource TemplatedParent}">
  480. <Binding.Converter>
  481. <syncfusion:SortDirectionToWidthConverter />
  482. </Binding.Converter>
  483. </Binding>
  484. </ColumnDefinition.MinWidth>
  485. </ColumnDefinition>
  486. <ColumnDefinition Width="*" />
  487. </Grid.ColumnDefinitions>
  488. <TextBlock Grid.Column="1" Foreground="{TemplateBinding Foreground}"
  489. FontSize="10" Margin="0,-4,0,0" SnapsToDevicePixels="True"
  490. Text="{TemplateBinding SortNumber}"
  491. Visibility="{TemplateBinding SortNumberVisibility}"
  492. VerticalAlignment="Bottom" />
  493. </Grid>
  494. <syncfusion:FilterToggleButton x:Name="PART_FilterToggleButton" Grid.Column="2"
  495. HorizontalAlignment="Stretch"
  496. SnapsToDevicePixels="True"
  497. Visibility="{TemplateBinding FilterIconVisiblity}"
  498. VerticalAlignment="Stretch">
  499. <syncfusion:FilterToggleButton.LayoutTransform>
  500. <RotateTransform Angle="90" />
  501. </syncfusion:FilterToggleButton.LayoutTransform>
  502. </syncfusion:FilterToggleButton>
  503. <Border x:Name="PART_FilterPopUpPresenter">
  504. <Border.LayoutTransform>
  505. <RotateTransform Angle="90" />
  506. </Border.LayoutTransform>
  507. </Border>
  508. </Grid>
  509. </Border>
  510. </Grid>
  511. </ControlTemplate>
  512. <Style BasedOn="{StaticResource {x:Type TabItem}}" TargetType="{x:Type local:DynamicTabItem}">
  513. <Setter Property="Template">
  514. <Setter.Value>
  515. <ControlTemplate TargetType="{x:Type local:DynamicTabItem}">
  516. <Border Name="Panel" BorderBrush="Gray" Background="Aqua" PreviewMouseRightButtonUp="Panel_OnPreviewMouseRightButtonUp" >
  517. <DockPanel>
  518. <Button x:Name="CloseButton" DockPanel.Dock="Right" Content="x" BorderThickness="0"
  519. Padding="5,0,5,0" Background="Transparent" VerticalContentAlignment="Center"
  520. HorizontalContentAlignment="Center"
  521. IsEnabled="True" Margin="2"
  522. Command="{TemplateBinding CloseTabCommand}" />
  523. <ContentPresenter
  524. x:Name="ContentSite"
  525. DockPanel.Dock="Left"
  526. VerticalAlignment="Center"
  527. HorizontalAlignment="Center"
  528. ContentSource="Header"
  529. Margin="10,0"
  530. />
  531. </DockPanel>
  532. </Border>
  533. <ControlTemplate.Triggers>
  534. <Trigger Property="IsSelected" Value="True">
  535. <Setter TargetName="Panel" Property="Background"
  536. Value="{Binding Path=(themes:ThemeManager.SelectedTabItemBackgroundBrush)}" />
  537. <Setter TargetName="Panel" Property="TextBlock.Foreground"
  538. Value="{Binding Path=(themes:ThemeManager.SelectedTabItemForegroundBrush)}" />
  539. </Trigger>
  540. <Trigger Property="IsSelected" Value="False">
  541. <Setter TargetName="Panel" Property="Background"
  542. Value="{Binding Path=(themes:ThemeManager.WorkspaceBackgroundBrush)}" />
  543. <Setter TargetName="Panel" Property="TextBlock.Foreground"
  544. Value="{Binding Path=(themes:ThemeManager.WorkspaceForegroundBrush)}" />
  545. </Trigger>
  546. <Trigger Property="CanClose" Value="True">
  547. <Setter TargetName="CloseButton" Property="Visibility" Value="Visible" />
  548. </Trigger>
  549. <Trigger Property="CanClose" Value="False">
  550. <Setter TargetName="CloseButton" Property="Visibility" Value="Collapsed" />
  551. </Trigger>
  552. <Trigger Property="TabStripPlacement" Value="{x:Static Dock.Top}">
  553. <Setter TargetName="Panel" Property="CornerRadius" Value="5,5,0,0" />
  554. <Setter TargetName="Panel" Property="Margin" Value="0,0,2,0" />
  555. <Setter TargetName="Panel" Property="BorderThickness" Value="0.75,0.75,0.75,0" />
  556. </Trigger>
  557. <Trigger Property="TabStripPlacement" Value="{x:Static Dock.Bottom}">
  558. <Setter TargetName="Panel" Property="CornerRadius" Value="0,0,5,5" />
  559. <Setter TargetName="Panel" Property="Margin" Value="0,0,2,0" />
  560. <Setter TargetName="Panel" Property="BorderThickness" Value="0.75,0,0.75,0.75" />
  561. </Trigger>
  562. </ControlTemplate.Triggers>
  563. </ControlTemplate>
  564. </Setter.Value>
  565. </Setter>
  566. </Style>
  567. <!-- ~1~ This template explains how to render a tab item with a close button. @1@ -->
  568. <!-- <DataTemplate x:Key="ClosableTabItemHeader"> -->
  569. <!-- <DockPanel MinWidth="120"> -->
  570. <!-- <Button DockPanel.Dock="Right" Command="ApplicationCommands.Delete" CommandParameter="{Binding}" Content="X" Cursor="Hand" Focusable="False" FontSize="10" FontWeight="Bold" Height="16" Width="16" /> -->
  571. <!-- <TextBlock Padding="0,0,10,0" Text="{Binding DisplayName}" VerticalAlignment="Center" /> -->
  572. <!-- </DockPanel> -->
  573. <!-- </DataTemplate> -->
  574. <!-- ~1~ This template explains how to render a tab item with a new button. @1@ -->
  575. <!-- <DataTemplate x:Key="NewTabItemHeader"> -->
  576. <!-- <Button Command="{Binding NewTabCommand, RelativeSource={RelativeSource AncestorType={x:Type local:DynamicTabControl}}}" Content="+" Cursor="Hand" Focusable="False" FontWeight="Bold" -->
  577. <!-- Width="{Binding ActualHeight, RelativeSource={RelativeSource Self}}"/> -->
  578. <!-- </DataTemplate> -->
  579. <Style BasedOn="{StaticResource {x:Type TabControl}}" TargetType="{x:Type local:DynamicTabControl}">
  580. <Setter Property="Template">
  581. <Setter.Value>
  582. <ControlTemplate TargetType="{x:Type local:DynamicTabControl}">
  583. <Grid Background="Transparent">
  584. <Grid.RowDefinitions>
  585. <RowDefinition Height="Auto" />
  586. <RowDefinition Height="*" />
  587. <RowDefinition Height="Auto" />
  588. </Grid.RowDefinitions>
  589. <Border x:Name="Separator" BorderBrush="Gray">
  590. <DockPanel x:Name="Panel" Background="{Binding Path=(themes:ThemeManager.WorkspaceBackgroundBrush)}">
  591. <Button x:Name="AddButton" DockPanel.Dock="Right" Content="+"
  592. BorderThickness="0" Padding="5,0,5,0" Background="Transparent"
  593. Command="{TemplateBinding CreateTabCommand}" />
  594. <TabPanel IsItemsHost="true" Background="Transparent" />
  595. </DockPanel>
  596. </Border>
  597. <Border
  598. x:Name="Content"
  599. Grid.Row="1"
  600. Background="{Binding Path=(themes:ThemeManager.WorkspaceBackgroundBrush)}"
  601. BorderThickness="0">
  602. <ContentPresenter ContentSource="SelectedContent" />
  603. </Border>
  604. </Grid>
  605. <ControlTemplate.Triggers>
  606. <Trigger Property="CanCreateTab" Value="True">
  607. <Setter TargetName="AddButton" Property="Visibility" Value="Visible" />
  608. </Trigger>
  609. <Trigger Property="CanCreateTab" Value="False">
  610. <Setter TargetName="AddButton" Property="Visibility" Value="Collapsed" />
  611. </Trigger>
  612. <!-- <Trigger Property="TabStripPlacement" Value="{x:Static Dock.Top}"> -->
  613. <!-- <Setter TargetName="Panel" Property="Grid.Row" Value="0" /> -->
  614. <!-- <Setter TargetName="Content" Property="BorderThickness" Value="0,0.75,0,0" /> -->
  615. <!-- <Setter TargetName="Content" Property="Padding" Value="0,2,0,0" /> -->
  616. <!-- </Trigger> -->
  617. <MultiTrigger>
  618. <MultiTrigger.Conditions>
  619. <Condition Property="TabStripPlacement" Value="{x:Static Dock.Top}" />
  620. <Condition Property="TabStripVisible" Value="False"/>
  621. </MultiTrigger.Conditions>
  622. <MultiTrigger.Setters>
  623. <Setter TargetName="Separator" Property="Grid.Row" Value="0" />
  624. <Setter TargetName="Separator" Property="BorderThickness" Value="0,0,0,0" />
  625. <Setter TargetName="Content" Property="Padding" Value="0,0,0,0" />
  626. </MultiTrigger.Setters>
  627. </MultiTrigger>
  628. <MultiTrigger>
  629. <MultiTrigger.Conditions>
  630. <Condition Property="TabStripPlacement" Value="{x:Static Dock.Top}" />
  631. <Condition Property="TabStripVisible" Value="True"/>
  632. </MultiTrigger.Conditions>
  633. <MultiTrigger.Setters>
  634. <Setter TargetName="Separator" Property="Grid.Row" Value="0" />
  635. <Setter TargetName="Separator" Property="BorderThickness" Value="0,0,0,0.75" />
  636. <Setter TargetName="Separator" Property="Margin" Value="0,0,0,1.5" />
  637. <Setter TargetName="Content" Property="Padding" Value="0,0,0,0" />
  638. </MultiTrigger.Setters>
  639. </MultiTrigger>
  640. <MultiTrigger>
  641. <MultiTrigger.Conditions>
  642. <Condition Property="TabStripPlacement" Value="{x:Static Dock.Bottom}" />
  643. <Condition Property="TabStripVisible" Value="False"/>
  644. </MultiTrigger.Conditions>
  645. <MultiTrigger.Setters>
  646. <Setter TargetName="Separator" Property="Grid.Row" Value="2" />
  647. <Setter TargetName="Separator" Property="BorderThickness" Value="0,0,0,0" />
  648. <Setter TargetName="Content" Property="Padding" Value="0,0,0,0" />
  649. </MultiTrigger.Setters>
  650. </MultiTrigger>
  651. <MultiTrigger>
  652. <MultiTrigger.Conditions>
  653. <Condition Property="TabStripPlacement" Value="{x:Static Dock.Bottom}" />
  654. <Condition Property="TabStripVisible" Value="True"/>
  655. </MultiTrigger.Conditions>
  656. <MultiTrigger.Setters>
  657. <Setter TargetName="Separator" Property="Grid.Row" Value="2" />
  658. <Setter TargetName="Separator" Property="BorderThickness" Value="0,0.75,0,0" />
  659. <Setter TargetName="Separator" Property="Margin" Value="0,0,0,0" />
  660. <Setter TargetName="Content" Property="Margin" Value="0,0,0,0" />
  661. <Setter TargetName="Content" Property="Padding" Value="0,0,0,2" />
  662. </MultiTrigger.Setters>
  663. </MultiTrigger>
  664. </ControlTemplate.Triggers>
  665. </ControlTemplate>
  666. </Setter.Value>
  667. </Setter>
  668. </Style>
  669. </ResourceDictionary>