OtherStyle.xaml 49 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721
  1. <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  2. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  3. xmlns:sys="clr-namespace:System;assembly=mscorlib">
  4. <Style x:Key="MySliderStyle" TargetType="{x:Type Slider}">
  5. <Setter Property="IsSnapToTickEnabled" Value="True"/>
  6. <Setter Property="TickFrequency" Value="0.01"/>
  7. <Setter Property="Template">
  8. <Setter.Value>
  9. <ControlTemplate TargetType="{x:Type Slider}">
  10. <Grid>
  11. <Grid.ColumnDefinitions>
  12. <ColumnDefinition Width="*"/>
  13. </Grid.ColumnDefinitions>
  14. <Grid Grid.Column="0">
  15. <Rectangle Margin="10,0,10,0" Fill="Gray" Height="4"/>
  16. <!-- Slider的背景 -->
  17. <Track Name="PART_Track" IsDirectionReversed="False">
  18. <Track.Thumb>
  19. <Thumb>
  20. <!-- Slider的滑块 -->
  21. <Thumb.Template>
  22. <ControlTemplate TargetType="{x:Type Thumb}">
  23. <!--<Rectangle Width="14" Height="24" Fill="{StaticResource ThemeColor}"/>-->
  24. <Ellipse Width="24" Height="24" Fill="{StaticResource ThemeColor}" />
  25. <!-- Slider的滑块样式 -->
  26. </ControlTemplate>
  27. </Thumb.Template>
  28. </Thumb>
  29. </Track.Thumb>
  30. <Track.DecreaseRepeatButton>
  31. <RepeatButton Command="Slider.DecreaseLarge">
  32. <!-- 划过的地方 -->
  33. <RepeatButton.Template>
  34. <ControlTemplate TargetType="{x:Type RepeatButton}">
  35. <Rectangle Fill="{StaticResource SubThemeColor}" Height="10"/>
  36. <!-- 划过的地方的样式 -->
  37. </ControlTemplate>
  38. </RepeatButton.Template>
  39. </RepeatButton>
  40. </Track.DecreaseRepeatButton>
  41. <Track.IncreaseRepeatButton>
  42. <RepeatButton Command="Slider.IncreaseLarge">
  43. <RepeatButton.Template>
  44. <ControlTemplate TargetType="{x:Type RepeatButton}">
  45. <Rectangle Fill="Transparent" Height="10"/>
  46. </ControlTemplate>
  47. </RepeatButton.Template>
  48. </RepeatButton>
  49. </Track.IncreaseRepeatButton>
  50. </Track>
  51. </Grid>
  52. </Grid>
  53. </ControlTemplate>
  54. </Setter.Value>
  55. </Setter>
  56. </Style>
  57. <Style x:Key="ThemeProgressBar" TargetType="{x:Type ProgressBar}">
  58. <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  59. <Setter Property="SnapsToDevicePixels" Value="True"/>
  60. <Setter Property="Height" Value="9"/>
  61. <Setter Property="Background" Value="{StaticResource ThemeColor}"/>
  62. <Setter Property="FontSize" Value="10"/>
  63. <Setter Property="Padding" Value="5,0"/>
  64. <Setter Property="Template">
  65. <Setter.Value>
  66. <ControlTemplate TargetType="{x:Type ProgressBar}">
  67. <Grid Background="#00000000">
  68. <Grid.RowDefinitions>
  69. <RowDefinition Height="Auto"/>
  70. </Grid.RowDefinitions>
  71. <Grid Height="{TemplateBinding Height}">
  72. <Border Background="#000000" CornerRadius="5" Opacity="0.05"/>
  73. <Border BorderBrush="#000000" BorderThickness="0" CornerRadius="5" Opacity="0.1"/>
  74. <Grid Margin="{TemplateBinding BorderThickness}">
  75. <Border x:Name="PART_Track"/>
  76. <Grid x:Name="PART_Indicator" ClipToBounds="True" HorizontalAlignment="Left" >
  77. <Grid x:Name="Animation" RenderTransformOrigin="0.5,0.5">
  78. <Grid.RenderTransform>
  79. <TransformGroup>
  80. <ScaleTransform ScaleY="-1" ScaleX="1"/>
  81. <SkewTransform AngleY="0" AngleX="0"/>
  82. <RotateTransform Angle="180"/>
  83. <TranslateTransform/>
  84. </TransformGroup>
  85. </Grid.RenderTransform>
  86. <Border x:Name="Bor" Background="{TemplateBinding Background}" CornerRadius="5"/>
  87. </Grid>
  88. </Grid>
  89. </Grid>
  90. </Grid>
  91. </Grid>
  92. <ControlTemplate.Triggers>
  93. <Trigger Property="IsEnabled" Value="False">
  94. <Setter Property="Background" Value="{StaticResource ThemeColor}"/>
  95. </Trigger>
  96. </ControlTemplate.Triggers>
  97. </ControlTemplate>
  98. </Setter.Value>
  99. </Setter>
  100. </Style>
  101. <Style x:Key="ListBoxItemContainerStyle1" TargetType="{x:Type ListBoxItem}">
  102. <Setter Property="SnapsToDevicePixels" Value="True"/>
  103. <Setter Property="Padding" Value="0"/>
  104. <Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
  105. <Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}"/>
  106. <Setter Property="Background" Value="Transparent"/>
  107. <Setter Property="BorderBrush" Value="Transparent"/>
  108. <Setter Property="BorderThickness" Value="0"/>
  109. <Setter Property="Template">
  110. <Setter.Value>
  111. <ControlTemplate TargetType="{x:Type ListBoxItem}">
  112. <Border x:Name="Bd" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true" Margin="0">
  113. <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  114. </Border>
  115. <ControlTemplate.Triggers>
  116. <MultiTrigger>
  117. <MultiTrigger.Conditions>
  118. <Condition Property="IsMouseOver" Value="True"/>
  119. </MultiTrigger.Conditions>
  120. <Setter Property="Background" TargetName="Bd" Value="{StaticResource TextColor}"/>
  121. <Setter Property="BorderBrush" TargetName="Bd" Value="{StaticResource TextColor}"/>
  122. </MultiTrigger>
  123. <MultiTrigger>
  124. <MultiTrigger.Conditions>
  125. <Condition Property="Selector.IsSelectionActive" Value="False"/>
  126. <Condition Property="IsSelected" Value="True"/>
  127. </MultiTrigger.Conditions>
  128. <Setter Property="Background" TargetName="Bd" Value="#515355"/>
  129. <Setter Property="BorderBrush" TargetName="Bd" Value="#515355"/>
  130. </MultiTrigger>
  131. <MultiTrigger>
  132. <MultiTrigger.Conditions>
  133. <Condition Property="Selector.IsSelectionActive" Value="True"/>
  134. <Condition Property="IsSelected" Value="True"/>
  135. </MultiTrigger.Conditions>
  136. <Setter Property="Background" TargetName="Bd" Value="#515355"/>
  137. <Setter Property="BorderBrush" TargetName="Bd" Value="#515355"/>
  138. </MultiTrigger>
  139. </ControlTemplate.Triggers>
  140. </ControlTemplate>
  141. </Setter.Value>
  142. </Setter>
  143. </Style>
  144. <Style x:Key="Tab" TargetType="{x:Type TabControl}">
  145. <Setter Property="TabStripPlacement" Value="Top" />
  146. <Setter Property="Margin" Value="2" />
  147. <Setter Property="Padding" Value="2" />
  148. <Setter Property="Background" Value="White" />
  149. <Setter Property="Template">
  150. <Setter.Value>
  151. <ControlTemplate TargetType="{x:Type TabControl}">
  152. <Grid ClipToBounds="True" SnapsToDevicePixels="True" KeyboardNavigation.TabNavigation="Local">
  153. <Grid.ColumnDefinitions>
  154. <ColumnDefinition Name="ColumnDefinition0" />
  155. <ColumnDefinition Width="0" Name="ColumnDefinition1" />
  156. </Grid.ColumnDefinitions>
  157. <Grid.RowDefinitions>
  158. <RowDefinition Height="Auto" Name="RowDefinition0" />
  159. <RowDefinition Height="*" Name="RowDefinition1" />
  160. </Grid.RowDefinitions>
  161. <Border x:Name="HeaderBorder"
  162. BorderBrush="{StaticResource TextColor}"
  163. BorderThickness="0,0,0,1"
  164. Background="#FAFAFA"
  165. Margin="0,0">
  166. <TabPanel IsItemsHost="True"
  167. Name="HeaderPanel"
  168. Panel.ZIndex="1"
  169. KeyboardNavigation.TabIndex="1"
  170. Grid.Column="0"
  171. Grid.Row="0" />
  172. </Border>
  173. <Grid Name="ContentPanel"
  174. KeyboardNavigation.TabIndex="2"
  175. KeyboardNavigation.TabNavigation="Local"
  176. KeyboardNavigation.DirectionalNavigation="Continue"
  177. Grid.Column="0"
  178. Grid.Row="1">
  179. <Border Background="{TemplateBinding Background}"
  180. BorderBrush="{TemplateBinding BorderBrush}"
  181. BorderThickness="{TemplateBinding BorderThickness}"
  182. CornerRadius="5">
  183. <ContentPresenter Content="{TemplateBinding SelectedContent}"
  184. ContentTemplate="{TemplateBinding SelectedContentTemplate}"
  185. ContentStringFormat="{TemplateBinding SelectedContentStringFormat}"
  186. ContentSource="SelectedContent"
  187. Name="PART_SelectedContentHost"
  188. Margin="2"
  189. SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}"
  190. />
  191. </Border>
  192. </Grid>
  193. </Grid>
  194. <ControlTemplate.Triggers>
  195. <Trigger Property="TabControl.TabStripPlacement" Value="Bottom">
  196. <Setter TargetName="HeaderPanel" Property="Grid.Row" Value="1" />
  197. <Setter TargetName="ContentPanel" Property="Grid.Row" Value="0" />
  198. <Setter TargetName="RowDefinition0" Property="RowDefinition.Height" Value="*" />
  199. <Setter TargetName="RowDefinition1" Property="RowDefinition.Height" Value="Auto" />
  200. <Setter TargetName="HeaderBorder" Property="FrameworkElement.Margin" Value="0,5,0,0" />
  201. </Trigger>
  202. <Trigger Property="TabControl.TabStripPlacement" Value="Left">
  203. <Setter TargetName="HeaderPanel" Property="Grid.Row" Value="0" />
  204. <Setter TargetName="ContentPanel" Property="Grid.Row" Value="0" />
  205. <Setter TargetName="HeaderPanel" Property="Grid.Column" Value="0" />
  206. <Setter TargetName="ContentPanel" Property="Grid.Column" Value="1" />
  207. <Setter TargetName="ColumnDefinition0" Property="ColumnDefinition.Width" Value="Auto" />
  208. <Setter TargetName="ColumnDefinition1" Property="ColumnDefinition.Width" Value="*" />
  209. <Setter TargetName="RowDefinition0" Property="RowDefinition.Height" Value="*" />
  210. <Setter TargetName="RowDefinition1" Property="RowDefinition.Height" Value="0" />
  211. <Setter TargetName="HeaderBorder" Property="FrameworkElement.Margin" Value="0,0,5,0" />
  212. </Trigger>
  213. <Trigger Property="TabControl.TabStripPlacement" Value="Right">
  214. <Setter TargetName="HeaderPanel" Property="Grid.Row" Value="0" />
  215. <Setter TargetName="ContentPanel" Property="Grid.Row" Value="0" />
  216. <Setter TargetName="HeaderPanel" Property="Grid.Column" Value="1" />
  217. <Setter TargetName="ContentPanel" Property="Grid.Column" Value="0" />
  218. <Setter TargetName="ColumnDefinition0" Property="ColumnDefinition.Width" Value="*" />
  219. <Setter TargetName="ColumnDefinition1" Property="ColumnDefinition.Width" Value="Auto" />
  220. <Setter TargetName="RowDefinition0" Property="RowDefinition.Height" Value="*" />
  221. <Setter TargetName="RowDefinition1" Property="RowDefinition.Height" Value="0" />
  222. <Setter TargetName="HeaderBorder" Property="FrameworkElement.Margin" Value="5,0,0,0" />
  223. </Trigger>
  224. <Trigger Property="UIElement.IsEnabled" Value="False">
  225. <Setter Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
  226. </Trigger>
  227. </ControlTemplate.Triggers>
  228. </ControlTemplate>
  229. </Setter.Value>
  230. </Setter>
  231. </Style>
  232. <Style x:Key="TabTheme" TargetType="{x:Type TabItem}">
  233. <Setter Property="Background" Value="Transparent" />
  234. <Setter Property="BorderBrush" Value="{StaticResource ThemeColor}"/>
  235. <Setter Property="BorderThickness" Value="0"/>
  236. <Setter Property="Template">
  237. <Setter.Value>
  238. <ControlTemplate TargetType="{x:Type TabItem}">
  239. <Border x:Name="PART_Border" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2">
  240. <Grid Margin="16,4">
  241. <Grid.RowDefinitions>
  242. <RowDefinition Height = "auto"/>
  243. <RowDefinition Height = "2"/>
  244. <RowDefinition Height = "auto"/>
  245. </Grid.RowDefinitions>
  246. <Border BorderBrush="Black"/>
  247. <ContentPresenter x:Name="Content" Grid.Row="0" ContentSource="Header" Content="{TemplateBinding Header}" MinWidth="40" Width="auto" VerticalAlignment="Center" HorizontalAlignment="Center" TextElement.Foreground="Black" TextElement.FontSize="15"/>
  248. <Border x:Name="SelectedBar" Grid.Row="2" Background="{TemplateBinding BorderBrush}" Height="3" VerticalAlignment="Center" HorizontalAlignment="Center" Width="40" CornerRadius="0"/>
  249. </Grid>
  250. </Border>
  251. <ControlTemplate.Triggers>
  252. <Trigger Property="IsSelected" Value="True">
  253. <Setter TargetName="SelectedBar" Property="Visibility" Value="Visible" />
  254. <Setter TargetName="Content" Property="TextElement.Foreground" Value="Black"/>
  255. <Setter TargetName="Content" Property="TextElement.FontWeight" Value="Bold"/>
  256. <Setter TargetName="Content" Property="TextElement.FontSize" Value="14"/>
  257. </Trigger>
  258. <Trigger Property="IsSelected" Value="False">
  259. <Setter TargetName="SelectedBar" Property="Visibility" Value="Hidden" />
  260. <Setter TargetName="Content" Property="TextElement.Foreground" Value="Gray"/>
  261. <Setter TargetName="Content" Property="TextElement.FontWeight" Value="Bold"/>
  262. <Setter TargetName="Content" Property="TextElement.FontSize" Value="14"/>
  263. <!--<Setter TargetName="Content" Property="TextElement.FontSize" Value="12"/>-->
  264. </Trigger>
  265. </ControlTemplate.Triggers>
  266. </ControlTemplate>
  267. </Setter.Value>
  268. </Setter>
  269. </Style>
  270. <BorderGapMaskConverter x:Key="BorderGapMaskConverter"/>
  271. <Style TargetType="{x:Type GroupBox}">
  272. <Setter Property="BorderBrush" Value="{StaticResource DarkBorderColor}"/>
  273. <Setter Property="BorderThickness" Value="1"/>
  274. <Setter Property="Template">
  275. <Setter.Value>
  276. <ControlTemplate TargetType="{x:Type GroupBox}">
  277. <Grid SnapsToDevicePixels="true">
  278. <Grid.ColumnDefinitions>
  279. <ColumnDefinition Width="6"/>
  280. <ColumnDefinition Width="Auto"/>
  281. <ColumnDefinition Width="*"/>
  282. <ColumnDefinition Width="6"/>
  283. </Grid.ColumnDefinitions>
  284. <Grid.RowDefinitions>
  285. <RowDefinition Height="Auto"/>
  286. <RowDefinition Height="Auto"/>
  287. <RowDefinition Height="*"/>
  288. <RowDefinition Height="6"/>
  289. </Grid.RowDefinitions>
  290. <Border Background="{TemplateBinding Background}" BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4" Grid.Column="0" Grid.ColumnSpan="4" Grid.RowSpan="3" Grid.Row="1"/>
  291. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="4" Grid.ColumnSpan="4" Grid.RowSpan="3" Grid.Row="1">
  292. <Border.OpacityMask>
  293. <MultiBinding ConverterParameter="7" Converter="{StaticResource BorderGapMaskConverter}">
  294. <Binding ElementName="Header" Path="ActualWidth"/>
  295. <Binding Path="ActualWidth" RelativeSource="{RelativeSource Mode=Self}"/>
  296. <Binding Path="ActualHeight" RelativeSource="{RelativeSource Mode=Self}"/>
  297. </MultiBinding>
  298. </Border.OpacityMask>
  299. </Border>
  300. <Border x:Name="Header" Grid.Column="1" Padding="3,1,3,0" Grid.RowSpan="2" Grid.Row="0">
  301. <ContentPresenter ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
  302. </Border>
  303. <ContentPresenter Grid.Column="1" Grid.ColumnSpan="2" Margin="{TemplateBinding Padding}" Grid.Row="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
  304. </Grid>
  305. </ControlTemplate>
  306. </Setter.Value>
  307. </Setter>
  308. </Style>
  309. <SolidColorBrush x:Key="Expander.Static.Circle.Stroke" Color="#FF333333"/>
  310. <SolidColorBrush x:Key="Expander.Static.Circle.Fill" Color="#FFFFFFFF"/>
  311. <SolidColorBrush x:Key="Expander.Static.Arrow.Stroke" Color="#FF333333"/>
  312. <SolidColorBrush x:Key="Expander.MouseOver.Circle.Stroke" Color="#FF5593FF"/>
  313. <SolidColorBrush x:Key="Expander.MouseOver.Circle.Fill" Color="#FFF3F9FF"/>
  314. <SolidColorBrush x:Key="Expander.MouseOver.Arrow.Stroke" Color="#FF000000"/>
  315. <SolidColorBrush x:Key="Expander.Pressed.Circle.Stroke" Color="#FF3C77DD"/>
  316. <SolidColorBrush x:Key="Expander.Pressed.Circle.Fill" Color="#FFD9ECFF"/>
  317. <SolidColorBrush x:Key="Expander.Pressed.Arrow.Stroke" Color="#FF000000"/>
  318. <SolidColorBrush x:Key="Expander.Disabled.Circle.Stroke" Color="#FFBCBCBC"/>
  319. <SolidColorBrush x:Key="Expander.Disabled.Circle.Fill" Color="#FFE6E6E6"/>
  320. <SolidColorBrush x:Key="Expander.Disabled.Arrow.Stroke" Color="#FF707070"/>
  321. <Style x:Key="ExpanderHeaderFocusVisual">
  322. <Setter Property="Control.Template">
  323. <Setter.Value>
  324. <ControlTemplate>
  325. <Border>
  326. <Rectangle Margin="0" StrokeDashArray="1 2" Stroke="Black" SnapsToDevicePixels="true" StrokeThickness="1"/>
  327. </Border>
  328. </ControlTemplate>
  329. </Setter.Value>
  330. </Setter>
  331. </Style>
  332. <Style x:Key="ExpanderDownHeaderStyle" TargetType="{x:Type ToggleButton}">
  333. <Setter Property="Template">
  334. <Setter.Value>
  335. <ControlTemplate TargetType="{x:Type ToggleButton}">
  336. <Border Padding="{TemplateBinding Padding}">
  337. <Grid Background="Transparent" SnapsToDevicePixels="False">
  338. <Grid.ColumnDefinitions>
  339. <ColumnDefinition Width="auto"/>
  340. <ColumnDefinition Width="*"/>
  341. </Grid.ColumnDefinitions>
  342. <Image x:Name="Down" Source="{StaticResource Down}" Width="19" Margin="4,0,0,0"/>
  343. <Image x:Name="Up" Source="{StaticResource UP}" Width="19" Margin="4,0,0,0"/>
  344. <ContentPresenter Grid.Column="1" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
  345. </Grid>
  346. </Border>
  347. <ControlTemplate.Triggers>
  348. <Trigger Property="IsChecked" Value="true">
  349. <Setter TargetName="Down" Property="Visibility" Value="Collapsed"/>
  350. <Setter TargetName="Up" Property="Visibility" Value="Visible"/>
  351. </Trigger>
  352. <Trigger Property="IsChecked" Value="False">
  353. <Setter TargetName="Down" Property="Visibility" Value="Visible"/>
  354. <Setter TargetName="Up" Property="Visibility" Value="Collapsed"/>
  355. </Trigger>
  356. </ControlTemplate.Triggers>
  357. </ControlTemplate>
  358. </Setter.Value>
  359. </Setter>
  360. </Style>
  361. <Style x:Key="ExpanderUpHeaderStyle" TargetType="{x:Type ToggleButton}">
  362. <Setter Property="Template">
  363. <Setter.Value>
  364. <ControlTemplate TargetType="{x:Type ToggleButton}">
  365. <Border Padding="{TemplateBinding Padding}">
  366. <Grid Background="Transparent" SnapsToDevicePixels="False">
  367. <Grid.ColumnDefinitions>
  368. <ColumnDefinition Width="19"/>
  369. <ColumnDefinition Width="*"/>
  370. </Grid.ColumnDefinitions>
  371. <Grid>
  372. <Grid.LayoutTransform>
  373. <TransformGroup>
  374. <TransformGroup.Children>
  375. <TransformCollection>
  376. <RotateTransform Angle="180"/>
  377. </TransformCollection>
  378. </TransformGroup.Children>
  379. </TransformGroup>
  380. </Grid.LayoutTransform>
  381. <Ellipse x:Name="circle" Fill="{StaticResource Expander.Static.Circle.Fill}" HorizontalAlignment="Center" Height="19" Stroke="{StaticResource Expander.Static.Circle.Stroke}" VerticalAlignment="Center" Width="19"/>
  382. <Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" Stroke="{StaticResource Expander.Static.Arrow.Stroke}" SnapsToDevicePixels="false" StrokeThickness="2" VerticalAlignment="Center"/>
  383. </Grid>
  384. <ContentPresenter Grid.Column="1" HorizontalAlignment="Left" Margin="4,0,0,0" RecognizesAccessKey="True" SnapsToDevicePixels="True" VerticalAlignment="Center"/>
  385. </Grid>
  386. </Border>
  387. <ControlTemplate.Triggers>
  388. <Trigger Property="IsChecked" Value="true">
  389. <Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
  390. </Trigger>
  391. <Trigger Property="IsMouseOver" Value="true">
  392. <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Stroke}"/>
  393. <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Fill}"/>
  394. <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.MouseOver.Arrow.Stroke}"/>
  395. </Trigger>
  396. <Trigger Property="IsPressed" Value="true">
  397. <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Stroke}"/>
  398. <Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
  399. <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Fill}"/>
  400. <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Pressed.Arrow.Stroke}"/>
  401. </Trigger>
  402. <Trigger Property="IsEnabled" Value="false">
  403. <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Stroke}"/>
  404. <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Fill}"/>
  405. <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Disabled.Arrow.Stroke}"/>
  406. </Trigger>
  407. </ControlTemplate.Triggers>
  408. </ControlTemplate>
  409. </Setter.Value>
  410. </Setter>
  411. </Style>
  412. <Style x:Key="ExpanderLeftHeaderStyle" TargetType="{x:Type ToggleButton}">
  413. <Setter Property="Template">
  414. <Setter.Value>
  415. <ControlTemplate TargetType="{x:Type ToggleButton}">
  416. <Border Padding="{TemplateBinding Padding}">
  417. <Grid Background="Transparent" SnapsToDevicePixels="False">
  418. <Grid.RowDefinitions>
  419. <RowDefinition Height="19"/>
  420. <RowDefinition Height="*"/>
  421. </Grid.RowDefinitions>
  422. <Grid>
  423. <Grid.LayoutTransform>
  424. <TransformGroup>
  425. <TransformGroup.Children>
  426. <TransformCollection>
  427. <RotateTransform Angle="90"/>
  428. </TransformCollection>
  429. </TransformGroup.Children>
  430. </TransformGroup>
  431. </Grid.LayoutTransform>
  432. <Ellipse x:Name="circle" Fill="{StaticResource Expander.Static.Circle.Fill}" HorizontalAlignment="Center" Height="19" Stroke="{StaticResource Expander.Static.Circle.Stroke}" VerticalAlignment="Center" Width="19"/>
  433. <Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" Stroke="{StaticResource Expander.Static.Arrow.Stroke}" SnapsToDevicePixels="false" StrokeThickness="2" VerticalAlignment="Center"/>
  434. </Grid>
  435. <ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" RecognizesAccessKey="True" Grid.Row="1" SnapsToDevicePixels="True" VerticalAlignment="Top"/>
  436. </Grid>
  437. </Border>
  438. <ControlTemplate.Triggers>
  439. <Trigger Property="IsChecked" Value="true">
  440. <Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
  441. </Trigger>
  442. <Trigger Property="IsMouseOver" Value="true">
  443. <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Stroke}"/>
  444. <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Fill}"/>
  445. <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.MouseOver.Arrow.Stroke}"/>
  446. </Trigger>
  447. <Trigger Property="IsPressed" Value="true">
  448. <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Stroke}"/>
  449. <Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
  450. <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Fill}"/>
  451. <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Pressed.Arrow.Stroke}"/>
  452. </Trigger>
  453. <Trigger Property="IsEnabled" Value="false">
  454. <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Stroke}"/>
  455. <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Fill}"/>
  456. <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Disabled.Arrow.Stroke}"/>
  457. </Trigger>
  458. </ControlTemplate.Triggers>
  459. </ControlTemplate>
  460. </Setter.Value>
  461. </Setter>
  462. </Style>
  463. <Style x:Key="ExpanderRightHeaderStyle" TargetType="{x:Type ToggleButton}">
  464. <Setter Property="Template">
  465. <Setter.Value>
  466. <ControlTemplate TargetType="{x:Type ToggleButton}">
  467. <Border Padding="{TemplateBinding Padding}">
  468. <Grid Background="Transparent" SnapsToDevicePixels="False">
  469. <Grid.RowDefinitions>
  470. <RowDefinition Height="19"/>
  471. <RowDefinition Height="*"/>
  472. </Grid.RowDefinitions>
  473. <Grid>
  474. <Grid.LayoutTransform>
  475. <TransformGroup>
  476. <TransformGroup.Children>
  477. <TransformCollection>
  478. <RotateTransform Angle="-90"/>
  479. </TransformCollection>
  480. </TransformGroup.Children>
  481. </TransformGroup>
  482. </Grid.LayoutTransform>
  483. <Ellipse x:Name="circle" Fill="{StaticResource Expander.Static.Circle.Fill}" HorizontalAlignment="Center" Height="19" Stroke="{StaticResource Expander.Static.Circle.Stroke}" VerticalAlignment="Center" Width="19"/>
  484. <Path x:Name="arrow" Data="M 1,1.5 L 4.5,5 L 8,1.5" HorizontalAlignment="Center" Stroke="{StaticResource Expander.Static.Arrow.Stroke}" SnapsToDevicePixels="false" StrokeThickness="2" VerticalAlignment="Center"/>
  485. </Grid>
  486. <ContentPresenter HorizontalAlignment="Center" Margin="0,4,0,0" RecognizesAccessKey="True" Grid.Row="1" SnapsToDevicePixels="True" VerticalAlignment="Top"/>
  487. </Grid>
  488. </Border>
  489. <ControlTemplate.Triggers>
  490. <Trigger Property="IsChecked" Value="true">
  491. <Setter Property="Data" TargetName="arrow" Value="M 1,4.5 L 4.5,1 L 8,4.5"/>
  492. </Trigger>
  493. <Trigger Property="IsMouseOver" Value="true">
  494. <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Stroke}"/>
  495. <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.MouseOver.Circle.Fill}"/>
  496. <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.MouseOver.Arrow.Stroke}"/>
  497. </Trigger>
  498. <Trigger Property="IsPressed" Value="true">
  499. <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Stroke}"/>
  500. <Setter Property="StrokeThickness" TargetName="circle" Value="1.5"/>
  501. <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Pressed.Circle.Fill}"/>
  502. <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Pressed.Arrow.Stroke}"/>
  503. </Trigger>
  504. <Trigger Property="IsEnabled" Value="false">
  505. <Setter Property="Stroke" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Stroke}"/>
  506. <Setter Property="Fill" TargetName="circle" Value="{StaticResource Expander.Disabled.Circle.Fill}"/>
  507. <Setter Property="Stroke" TargetName="arrow" Value="{StaticResource Expander.Disabled.Arrow.Stroke}"/>
  508. </Trigger>
  509. </ControlTemplate.Triggers>
  510. </ControlTemplate>
  511. </Setter.Value>
  512. </Setter>
  513. </Style>
  514. <Style x:Key="ExpanderStyle1" TargetType="{x:Type Expander}">
  515. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
  516. <Setter Property="Background" Value="Transparent"/>
  517. <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
  518. <Setter Property="VerticalContentAlignment" Value="Stretch"/>
  519. <Setter Property="BorderBrush" Value="Transparent"/>
  520. <Setter Property="BorderThickness" Value="1"/>
  521. <Setter Property="Template">
  522. <Setter.Value>
  523. <ControlTemplate TargetType="{x:Type Expander}">
  524. <Border Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3" SnapsToDevicePixels="true">
  525. <DockPanel>
  526. <ToggleButton x:Name="HeaderSite" ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" DockPanel.Dock="Top" FontStretch="{TemplateBinding FontStretch}" Foreground="{TemplateBinding Foreground}" FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" FontStyle="{TemplateBinding FontStyle}" FontFamily="{TemplateBinding FontFamily}" FontWeight="{TemplateBinding FontWeight}" FontSize="{TemplateBinding FontSize}" HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}" IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource Mode=TemplatedParent}}" Margin="1" MinWidth="0" MinHeight="0" Padding="{TemplateBinding Padding}" Style="{StaticResource ExpanderDownHeaderStyle}" VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"/>
  527. <ContentPresenter x:Name="ExpandSite" DockPanel.Dock="Bottom" Focusable="false" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Visibility="Collapsed"/>
  528. </DockPanel>
  529. </Border>
  530. <ControlTemplate.Triggers>
  531. <Trigger Property="IsExpanded" Value="true">
  532. <Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
  533. </Trigger>
  534. <Trigger Property="ExpandDirection" Value="Right">
  535. <Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Right"/>
  536. <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Left"/>
  537. <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderRightHeaderStyle}"/>
  538. </Trigger>
  539. <Trigger Property="ExpandDirection" Value="Up">
  540. <Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Top"/>
  541. <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Bottom"/>
  542. <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderUpHeaderStyle}"/>
  543. </Trigger>
  544. <Trigger Property="ExpandDirection" Value="Left">
  545. <Setter Property="DockPanel.Dock" TargetName="ExpandSite" Value="Left"/>
  546. <Setter Property="DockPanel.Dock" TargetName="HeaderSite" Value="Right"/>
  547. <Setter Property="Style" TargetName="HeaderSite" Value="{StaticResource ExpanderLeftHeaderStyle}"/>
  548. </Trigger>
  549. <Trigger Property="IsEnabled" Value="false">
  550. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  551. </Trigger>
  552. </ControlTemplate.Triggers>
  553. </ControlTemplate>
  554. </Setter.Value>
  555. </Setter>
  556. </Style>
  557. <Style TargetType="{x:Type DataGrid}">
  558. <Setter Property="BorderBrush" Value="#FF688CAF"/>
  559. <Setter Property="BorderThickness" Value="1"/>
  560. <Setter Property="RowDetailsVisibilityMode" Value="VisibleWhenSelected"/>
  561. <Setter Property="ScrollViewer.CanContentScroll" Value="true"/>
  562. <Setter Property="ScrollViewer.PanningMode" Value="Both"/>
  563. <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
  564. <Setter Property="AutoGenerateColumns" Value="False"/>
  565. <Setter Property="AlternationCount" Value="2"/>
  566. <Setter Property="Template">
  567. <Setter.Value>
  568. <ControlTemplate TargetType="{x:Type DataGrid}">
  569. <Grid>
  570. <Border Background="{TemplateBinding Background}" CornerRadius="0">
  571. <Border.Effect>
  572. <DropShadowEffect ShadowDepth="0" Direction="0" Color="#FFDADADA"/>
  573. </Border.Effect>
  574. </Border>
  575. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="True">
  576. <ScrollViewer x:Name="DG_ScrollViewer" Focusable="false">
  577. <ScrollViewer.Template>
  578. <ControlTemplate TargetType="{x:Type ScrollViewer}">
  579. <Grid>
  580. <Grid.ColumnDefinitions>
  581. <ColumnDefinition Width="Auto"/>
  582. <ColumnDefinition Width="*"/>
  583. <ColumnDefinition Width="Auto"/>
  584. </Grid.ColumnDefinitions>
  585. <Grid.RowDefinitions>
  586. <RowDefinition Height="Auto"/>
  587. <RowDefinition Height="*"/>
  588. <RowDefinition Height="Auto"/>
  589. </Grid.RowDefinitions>
  590. <Button Command="{x:Static DataGrid.SelectAllCommand}" Focusable="false" Style="{DynamicResource {ComponentResourceKey ResourceId=DataGridSelectAllButtonStyle, TypeInTargetAssembly={x:Type DataGrid}}}" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.All}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}" Width="{Binding CellsPanelHorizontalOffset, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
  591. <DataGridColumnHeadersPresenter x:Name="PART_ColumnHeadersPresenter" Grid.Column="1" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Column}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
  592. <ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" Grid.ColumnSpan="2" Grid.Row="1"/>
  593. <ScrollBar x:Name="PART_VerticalScrollBar" Grid.Column="2" Maximum="{TemplateBinding ScrollableHeight}" Orientation="Vertical" Grid.Row="1" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/>
  594. <Grid Grid.Column="1" Grid.Row="2">
  595. <Grid.ColumnDefinitions>
  596. <ColumnDefinition Width="{Binding NonFrozenColumnsViewportHorizontalOffset, RelativeSource={RelativeSource AncestorType={x:Type DataGrid}}}"/>
  597. <ColumnDefinition Width="*"/>
  598. </Grid.ColumnDefinitions>
  599. <ScrollBar x:Name="PART_HorizontalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
  600. </Grid>
  601. </Grid>
  602. </ControlTemplate>
  603. </ScrollViewer.Template>
  604. <ItemsPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
  605. </ScrollViewer>
  606. </Border>
  607. </Grid>
  608. </ControlTemplate>
  609. </Setter.Value>
  610. </Setter>
  611. <Style.Triggers>
  612. <MultiTrigger>
  613. <MultiTrigger.Conditions>
  614. <Condition Property="IsGrouping" Value="true"/>
  615. <Condition Property="VirtualizingPanel.IsVirtualizingWhenGrouping" Value="false"/>
  616. </MultiTrigger.Conditions>
  617. <Setter Property="ScrollViewer.CanContentScroll" Value="false"/>
  618. </MultiTrigger>
  619. </Style.Triggers>
  620. </Style>
  621. <Style TargetType="DataGridColumnHeader">
  622. <Setter Property="Background" Value="Transparent"/>
  623. <Setter Property="VerticalContentAlignment" Value="Center"/>
  624. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  625. <Setter Property="Template">
  626. <Setter.Value>
  627. <ControlTemplate TargetType="DataGridColumnHeader">
  628. <Grid Background="{TemplateBinding Background}">
  629. <!--<Grid.ColumnDefinitions>
  630. <ColumnDefinition/>
  631. <ColumnDefinition Width="20"/>
  632. </Grid.ColumnDefinitions>-->
  633. <ContentPresenter Margin="0 2 0 2" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
  634. <!--<TextBlock Grid.Column="1" x:Name="SortArrow" Visibility="Visible" VerticalAlignment="Center" FontFamily="/DataGrid;component/Fonts/#FontAwesome"/>-->
  635. </Grid>
  636. <!--<ControlTemplate.Triggers>
  637. <Trigger Property="SortDirection" Value="Ascending">
  638. <Setter TargetName="SortArrow" Property="Visibility" Value="Visible" />
  639. <Setter TargetName="SortArrow" Property="Text" Value="&#xf160;" />
  640. </Trigger>
  641. <Trigger Property="SortDirection" Value="Descending">
  642. <Setter TargetName="SortArrow" Property="Visibility" Value="Visible" />
  643. <Setter TargetName="SortArrow" Property="Text" Value="&#xf161;" />
  644. </Trigger>
  645. </ControlTemplate.Triggers>-->
  646. </ControlTemplate>
  647. </Setter.Value>
  648. </Setter>
  649. </Style>
  650. <Style TargetType="DataGridRow">
  651. <Setter Property="Cursor" Value="Hand"/>
  652. <Setter Property="Template" >
  653. <Setter.Value>
  654. <ControlTemplate TargetType="DataGridRow">
  655. <Grid >
  656. <Border x:Name="border" Background="{TemplateBinding Background}" BorderThickness="1" BorderBrush="Transparent"/>
  657. <DataGridCellsPresenter />
  658. </Grid>
  659. <ControlTemplate.Triggers>
  660. <Trigger Property="IsMouseOver" Value="True">
  661. <Setter Property="BorderBrush" TargetName="border" Value="#00BCD4"/>
  662. </Trigger>
  663. <Trigger Property="IsSelected" Value="true">
  664. <Setter Property="BorderBrush" TargetName="border" Value="#00BCD4"/>
  665. </Trigger>
  666. </ControlTemplate.Triggers>
  667. </ControlTemplate>
  668. </Setter.Value>
  669. </Setter>
  670. <Style.Triggers>
  671. <Trigger Property="ItemsControl.AlternationIndex"
  672. Value="0">
  673. <Setter Property="Background" Value="Transparent" />
  674. </Trigger>
  675. <Trigger Property="ItemsControl.AlternationIndex"
  676. Value="1">
  677. <Setter Property="Background" Value="Transparent" />
  678. </Trigger>
  679. </Style.Triggers>
  680. </Style>
  681. <Style TargetType="DataGridCell">
  682. <Setter Property="Background" Value="Transparent"/>
  683. <Setter Property="VerticalContentAlignment" Value="Center"/>
  684. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  685. <Setter Property="Template">
  686. <Setter.Value>
  687. <ControlTemplate TargetType="DataGridCell">
  688. <Grid Background="{TemplateBinding Background}">
  689. <ContentPresenter VerticalAlignment="{TemplateBinding VerticalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"/>
  690. </Grid>
  691. <ControlTemplate.Triggers>
  692. <Trigger Property="IsSelected" Value="true">
  693. <Setter Property="Foreground" Value="Black" />
  694. </Trigger>
  695. </ControlTemplate.Triggers>
  696. </ControlTemplate>
  697. </Setter.Value>
  698. </Setter>
  699. </Style>
  700. </ResourceDictionary>