终端一体化运控平台
Non puoi selezionare più di 25 argomenti Gli argomenti devono iniziare con una lettera o un numero, possono includere trattini ('-') e possono essere lunghi fino a 35 caratteri.
 
 
 

685 righe
48 KiB

  1. <Application x:Class="BPASmartClient.MilkWithTea.App"
  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:BPASmartClient.MilkWithTea"
  5. StartupUri="MainWindow.xaml">
  6. <Application.Resources>
  7. <Style x:Key="ScrollThumbs" TargetType="{x:Type Thumb}">
  8. <Setter Property="Template">
  9. <Setter.Value>
  10. <ControlTemplate TargetType="{x:Type Thumb}">
  11. <Grid x:Name="Grid">
  12. <Rectangle HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Fill="Transparent"/>
  13. <Border x:Name="Rectangle1" CornerRadius="5" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Width="Auto" Height="Auto" Background="{TemplateBinding Background}"/>
  14. </Grid>
  15. <ControlTemplate.Triggers>
  16. <Trigger Property="Tag" Value="Horizontal">
  17. <Setter TargetName="Rectangle1" Property="Width" Value="Auto"/>
  18. <Setter TargetName="Rectangle1" Property="Height" Value="7"/>
  19. </Trigger>
  20. </ControlTemplate.Triggers>
  21. </ControlTemplate>
  22. </Setter.Value>
  23. </Setter>
  24. </Style>
  25. <!--滚动条样式-->
  26. <Style x:Key="{x:Type ScrollBar}" TargetType="{x:Type ScrollBar}">
  27. <Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
  28. <Setter Property="Foreground" Value="LightGray"/>
  29. <Setter Property="Background" Value="Transparent"/>
  30. <Setter Property="Width" Value="11"/>
  31. <Setter Property="Template">
  32. <Setter.Value>
  33. <ControlTemplate TargetType="{x:Type ScrollBar}">
  34. <Grid x:Name="GridRoot" Width="14" Background="{TemplateBinding Background}">
  35. <Grid.RowDefinitions>
  36. <RowDefinition Height="*"/>
  37. </Grid.RowDefinitions>
  38. <!--This is scrollbar track-->
  39. <Track x:Name="PART_Track" Grid.Row="0" IsDirectionReversed="True" Focusable="False">
  40. <Track.Thumb>
  41. <Thumb x:Name="Thumb" Background="{TemplateBinding Foreground}" Style="{DynamicResource ScrollThumbs}"/>
  42. </Track.Thumb>
  43. <Track.IncreaseRepeatButton>
  44. <RepeatButton x:Name="PageUp" Command="ScrollBar.PageUpCommand" Opacity="0" Focusable="False"/>
  45. </Track.IncreaseRepeatButton>
  46. <Track.DecreaseRepeatButton>
  47. <RepeatButton x:Name="PageDown" Command="ScrollBar.PageDownCommand" Opacity="0" Focusable="False"/>
  48. </Track.DecreaseRepeatButton>
  49. </Track>
  50. </Grid>
  51. <ControlTemplate.Triggers>
  52. <Trigger Property="IsEnabled" Value="False">
  53. <Setter TargetName="Thumb" Property="Visibility" Value="Collapsed"/>
  54. </Trigger>
  55. <Trigger Property="Orientation" Value="Horizontal">
  56. <Setter TargetName="GridRoot" Property="LayoutTransform">
  57. <Setter.Value>
  58. <RotateTransform Angle="-90"/>
  59. </Setter.Value>
  60. </Setter>
  61. <Setter TargetName="PART_Track" Property="LayoutTransform">
  62. <Setter.Value>
  63. <RotateTransform Angle="-90"/>
  64. </Setter.Value>
  65. </Setter>
  66. <Setter Property="Width" Value="Auto"/>
  67. <Setter Property="Height" Value="12"/>
  68. <Setter TargetName="Thumb" Property="Tag" Value="Horizontal"/>
  69. <Setter TargetName="PageDown" Property="Command" Value="ScrollBar.PageLeftCommand"/>
  70. <Setter TargetName="PageUp" Property="Command" Value="ScrollBar.PageRightCommand"/>
  71. </Trigger>
  72. </ControlTemplate.Triggers>
  73. </ControlTemplate>
  74. </Setter.Value>
  75. </Setter>
  76. </Style>
  77. <!--datagrid标题栏样式-->
  78. <Style TargetType="DataGridColumnHeader">
  79. <Setter Property="SnapsToDevicePixels" Value="True" />
  80. <Setter Property="MinWidth" Value="0" />
  81. <Setter Property="MinHeight" Value="30" />
  82. <Setter Property="Foreground" Value="DarkSlateGray" />
  83. <Setter Property="FontSize" Value="18" />
  84. <Setter Property="Cursor" Value="Hand" />
  85. <Setter Property="Background" Value="#D3D3D3"/>
  86. <Setter Property="Template">
  87. <Setter.Value>
  88. <ControlTemplate TargetType="DataGridColumnHeader">
  89. <Grid>
  90. <Grid.ColumnDefinitions>
  91. <ColumnDefinition Width="*" />
  92. </Grid.ColumnDefinitions>
  93. <ContentPresenter Margin="0,0,0,0" VerticalAlignment="Center"
  94. HorizontalAlignment="Center" />
  95. <Path x:Name="SortArrow" Visibility="Collapsed" Data="M0,0 L1,0 0.5,1 z" Stretch="Fill"
  96. Grid.Column="0" Width="8" Height="6" Fill="#D3D3D3" Margin="0,0,50,0"
  97. VerticalAlignment="Center" RenderTransformOrigin="1,1" />
  98. <Rectangle Width="1" Fill="Black" HorizontalAlignment="Right" Grid.ColumnSpan="1" />
  99. </Grid>
  100. </ControlTemplate>
  101. </Setter.Value>
  102. </Setter>
  103. <Setter Property="Height" Value="25" />
  104. </Style>
  105. <Style TargetType="{x:Type DataGridCell}">
  106. <Setter Property="Background" Value="Transparent" />
  107. <Setter Property="BorderBrush" Value="#FF31879E" />
  108. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  109. <Setter Property="BorderThickness" Value="0" />
  110. <Setter Property="Template">
  111. <Setter.Value>
  112. <ControlTemplate TargetType="{x:Type DataGridCell}">
  113. <Border
  114. Background="{TemplateBinding Background}"
  115. BorderBrush="{TemplateBinding BorderBrush}"
  116. BorderThickness="{TemplateBinding BorderThickness}"
  117. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
  118. Height="{TemplateBinding Height}"
  119. SnapsToDevicePixels="True">
  120. <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
  121. </Border>
  122. </ControlTemplate>
  123. </Setter.Value>
  124. </Setter>
  125. </Style>
  126. <Style x:Key="buttonNormal" TargetType="{x:Type Button}">
  127. <Setter Property="FocusVisualStyle">
  128. <Setter.Value>
  129. <Style>
  130. <Setter Property="Control.Template">
  131. <Setter.Value>
  132. <ControlTemplate>
  133. <Rectangle Margin="2" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
  134. </ControlTemplate>
  135. </Setter.Value>
  136. </Setter>
  137. </Style>
  138. </Setter.Value>
  139. </Setter>
  140. <Setter Property="Background" Value="#58B0ED"/>
  141. <Setter Property="BorderBrush" Value="#FF707070"/>
  142. <Setter Property="Foreground" Value="White"/>
  143. <Setter Property="BorderThickness" Value="0"/>
  144. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  145. <Setter Property="VerticalContentAlignment" Value="Center"/>
  146. <Setter Property="Padding" Value="1"/>
  147. <Setter Property="Template">
  148. <Setter.Value>
  149. <ControlTemplate TargetType="{x:Type Button}">
  150. <Border x:Name="border" CornerRadius="10" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
  151. <ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  152. </Border>
  153. <ControlTemplate.Triggers>
  154. <Trigger Property="IsMouseOver" Value="True">
  155. <Setter Property="Background" TargetName="border" Value="#FF3C7FB1"/>
  156. <Setter Property="BorderBrush" TargetName="border" Value="#FF3C7FB1"/>
  157. </Trigger>
  158. <Trigger Property="IsPressed" Value="True">
  159. <Setter Property="Background" TargetName="border" Value="#58B0ED "/>
  160. <Setter Property="BorderBrush" TargetName="border" Value="#FF2C628B"/>
  161. </Trigger>
  162. <Trigger Property="ToggleButton.IsChecked" Value="True">
  163. <Setter Property="Background" TargetName="border" Value="#FF3C7FB1"/>
  164. <Setter Property="BorderBrush" TargetName="border" Value="#FF245A83"/>
  165. </Trigger>
  166. <Trigger Property="IsEnabled" Value="False">
  167. <Setter Property="Background" TargetName="border" Value="#58B0ED"/>
  168. <Setter Property="BorderBrush" TargetName="border" Value="#FFADB2B5"/>
  169. <Setter Property="Foreground" Value="White"/>
  170. </Trigger>
  171. </ControlTemplate.Triggers>
  172. </ControlTemplate>
  173. </Setter.Value>
  174. </Setter>
  175. </Style>
  176. <!--下拉列表样式-->
  177. <Style x:Key="ExpanderStyle" TargetType="{x:Type Expander}">
  178. <Setter Property="IsExpanded" Value="False"></Setter>
  179. <Setter Property="Margin" Value="40,20"/>
  180. <Setter Property="FontSize" Value="20"/>
  181. <Setter Property="FontWeight" Value="Bold"/>
  182. <Setter Property="Foreground" Value="DarkSlateGray"/>
  183. <Setter Property="Template">
  184. <Setter.Value>
  185. <ControlTemplate TargetType="{x:Type Expander}">
  186. <ControlTemplate.Resources>
  187. <Storyboard x:Key="STHide">
  188. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.LayoutTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"
  189. Storyboard.TargetName="ExpandSite">
  190. <EasingDoubleKeyFrame KeyTime="0:0:0.0"
  191. Value="1" />
  192. <EasingDoubleKeyFrame KeyTime="0:0:0.5"
  193. Value="0" />
  194. </DoubleAnimationUsingKeyFrames>
  195. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
  196. Storyboard.TargetName="ExpandSite">
  197. <EasingDoubleKeyFrame KeyTime="0:0:0.5"
  198. Value="1" />
  199. </DoubleAnimationUsingKeyFrames>
  200. </Storyboard>
  201. <Storyboard x:Key="STShow">
  202. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(FrameworkElement.LayoutTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"
  203. Storyboard.TargetName="ExpandSite">
  204. <EasingDoubleKeyFrame KeyTime="0"
  205. Value="0" />
  206. <EasingDoubleKeyFrame KeyTime="0:0:0.3"
  207. Value="1" />
  208. </DoubleAnimationUsingKeyFrames>
  209. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)"
  210. Storyboard.TargetName="ExpandSite">
  211. <EasingDoubleKeyFrame KeyTime="0"
  212. Value="0" />
  213. <EasingDoubleKeyFrame KeyTime="0:0:0.6"
  214. Value="1" />
  215. </DoubleAnimationUsingKeyFrames>
  216. </Storyboard>
  217. </ControlTemplate.Resources>
  218. <Grid>
  219. <Grid.RowDefinitions>
  220. <RowDefinition Height="auto"></RowDefinition>
  221. <RowDefinition Height="auto"></RowDefinition>
  222. </Grid.RowDefinitions>
  223. <Border BorderThickness="1" Background="White" BorderBrush="Black" CornerRadius="10" Padding="10,2">
  224. <Grid>
  225. <Grid.ColumnDefinitions>
  226. <ColumnDefinition Width="200"/>
  227. <ColumnDefinition Width="50"/>
  228. </Grid.ColumnDefinitions>
  229. <ContentPresenter ContentTemplate="{TemplateBinding HeaderTemplate}" Content="{TemplateBinding Header}" VerticalAlignment="Center">
  230. </ContentPresenter>
  231. <ToggleButton x:Name="HeaderSite" Grid.Column="0" Grid.ColumnSpan="2" Background="Transparent" HorizontalAlignment="Right" HorizontalContentAlignment="Right" Width="200"
  232. ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
  233. IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
  234. Style="{DynamicResource ExpanderToggleButtonStyle}" />
  235. </Grid>
  236. </Border>
  237. <ContentPresenter x:Name="ExpandSite" Grid.Row="1"
  238. ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False"
  239. HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" Visibility="Collapsed" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
  240. <ContentPresenter.LayoutTransform>
  241. <TransformGroup>
  242. <ScaleTransform />
  243. <SkewTransform />
  244. <RotateTransform />
  245. <TranslateTransform />
  246. </TransformGroup>
  247. </ContentPresenter.LayoutTransform>
  248. </ContentPresenter>
  249. </Grid>
  250. <ControlTemplate.Triggers>
  251. <EventTrigger RoutedEvent="FrameworkElement.Loaded">
  252. <BeginStoryboard Storyboard="{StaticResource STHide}" />
  253. </EventTrigger>
  254. <EventTrigger RoutedEvent="Expander.Expanded">
  255. <BeginStoryboard x:Name="STShow_BeginStoryboard"
  256. Storyboard="{StaticResource STShow}" />
  257. </EventTrigger>
  258. <EventTrigger RoutedEvent="Expander.Collapsed">
  259. <BeginStoryboard Storyboard="{StaticResource STHide}" />
  260. </EventTrigger>
  261. <Trigger Property="IsMouseOver" Value="True">
  262. <Setter Property="Background" Value=" #E1FFFF"/>
  263. </Trigger>
  264. <Trigger Property="IsExpanded" Value="True">
  265. <Setter Property="Visibility" TargetName="ExpandSite" Value="Visible"/>
  266. </Trigger>
  267. </ControlTemplate.Triggers>
  268. </ControlTemplate>
  269. </Setter.Value>
  270. </Setter>
  271. </Style>
  272. <Style x:Key="ExpanderToggleButtonStyle" TargetType="{x:Type ToggleButton}">
  273. <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
  274. <Setter Property="Height" Value="30" />
  275. <Setter Property="Background" Value="Transparent" />
  276. <Setter Property="Foreground" Value="DarkSlateGray"/>
  277. <Setter Property="FontSize" Value="22" />
  278. <Setter Property="FontFamily" Value="宋体" />
  279. <Setter Property="FontWeight" Value="Bold" />
  280. <Setter Property="BorderThickness" Value="0"/>
  281. <Setter Property="HorizontalContentAlignment" Value="Center"/>
  282. <Setter Property="VerticalContentAlignment" Value="Center"/>
  283. <Setter Property="Width" Value="50"></Setter>
  284. <Setter Property="Padding" Value="5 5"/>
  285. <Setter Property="Template">
  286. <Setter.Value>
  287. <ControlTemplate TargetType="{x:Type ToggleButton}">
  288. <Canvas Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"
  289. Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
  290. <Canvas x:Name="canvNormal" Visibility="Visible"
  291. Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"
  292. Background="{TemplateBinding Background}" SnapsToDevicePixels="True" Canvas.Right="30">
  293. <Path Data="M 0 0 L 6 6 12 0 " Stroke="#FF37A0EA" StrokeThickness="2" Canvas.Right="5" Canvas.Top="10"/>
  294. <Path Data="M 0 0 L 6 6 12 0 " Stroke="#FF37A0EA" StrokeThickness="2" Canvas.Right="5" Canvas.Top="15"/>
  295. </Canvas>
  296. <Canvas x:Name="canvChecked" Visibility="Hidden"
  297. Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"
  298. Background="{TemplateBinding Background}" SnapsToDevicePixels="True" Canvas.Right="30">
  299. <Path Data="M 0 0 L 6 -6 12 0 " Stroke="#FF37A0EA" StrokeThickness="2" Canvas.Right="5" Canvas.Top="15"/>
  300. <Path Data="M 0 0 L 6 -6 12 0 " Stroke="#FF37A0EA" StrokeThickness="2" Canvas.Right="5" Canvas.Top="20"/>
  301. </Canvas>
  302. <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
  303. Margin="{TemplateBinding Padding}"
  304. RecognizesAccessKey="True"
  305. SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
  306. VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
  307. </Canvas>
  308. <ControlTemplate.Triggers>
  309. <Trigger Property="IsPressed" Value="true">
  310. <Setter Property="Background" Value="SlateGray" />
  311. </Trigger>
  312. <Trigger Property="IsChecked" Value="true">
  313. <Setter Property="Visibility" TargetName="canvChecked" Value="Visible" />
  314. <Setter Property="Visibility" TargetName="canvNormal" Value="Hidden" />
  315. </Trigger>
  316. <Trigger Property="IsEnabled" Value="false">
  317. <Setter Property="Foreground" Value="Gray"/>
  318. </Trigger>
  319. </ControlTemplate.Triggers>
  320. </ControlTemplate>
  321. </Setter.Value>
  322. </Setter>
  323. </Style>
  324. <!--GroupBox-->
  325. <Style x:Key="GroupBoxStyle1" TargetType="{x:Type GroupBox}">
  326. <Setter Property="BorderBrush" Value="#D5DFE5"/>
  327. <Setter Property="BorderThickness" Value="1"/>
  328. <Setter Property="Margin" Value="20"/>
  329. <Setter Property="BorderThickness" Value="10"/>
  330. <Setter Property="Template">
  331. <Setter.Value>
  332. <ControlTemplate TargetType="{x:Type GroupBox}">
  333. <Grid SnapsToDevicePixels="true">
  334. <Grid.ColumnDefinitions>
  335. <ColumnDefinition Width="6"/>
  336. <ColumnDefinition Width="Auto"/>
  337. <ColumnDefinition Width="*"/>
  338. <ColumnDefinition Width="6"/>
  339. </Grid.ColumnDefinitions>
  340. <Grid.RowDefinitions>
  341. <RowDefinition Height="Auto"/>
  342. <RowDefinition Height="Auto" MinHeight="59"/>
  343. <RowDefinition Height="*"/>
  344. <RowDefinition Height="6"/>
  345. </Grid.RowDefinitions>
  346. <Border BorderBrush="Transparent" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="4" Grid.Column="0" CornerRadius="4" Grid.Row="0" Grid.RowSpan="4" Background="Transparent" Margin="0,-0.25,0,0.25">
  347. <Border.Effect>
  348. <DropShadowEffect Color="#FFAAAAAA" Direction="350"/>
  349. </Border.Effect>
  350. </Border>
  351. <Border x:Name="Header" Grid.Column="1" Padding="3,1,3,0" Grid.Row="1" Grid.RowSpan="1" HorizontalAlignment="Right" Background="{x:Null}" Margin="0" Height="16.96" VerticalAlignment="Top"/>
  352. <ContentPresenter Grid.ColumnSpan="2" Grid.Column="1" Margin="{TemplateBinding Padding}" Grid.Row="2" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Grid.RowSpan="1"/>
  353. <Border BorderBrush="White" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="4" CornerRadius="4" Grid.Row="1" Grid.RowSpan="3">
  354. <Border BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="3">
  355. <Border BorderBrush="White" BorderThickness="{TemplateBinding BorderThickness}" CornerRadius="2"/>
  356. </Border>
  357. </Border>
  358. <Grid x:Name="HeaderGrid" Height="47.2" VerticalAlignment="Stretch" Grid.Column="2" Grid.ColumnSpan="2" Grid.RowSpan="1" Margin="0,7.982,-16,3.818" Grid.Row="1" HorizontalAlignment="Right">
  359. <Path Data="M12.19,0 L12.290733,14.847 -1.3000648E-08,14.847 z" Height="16.1" Margin="0,0,8.067,0" RenderTransformOrigin="0.499999978361064,0.499999995889058" Stretch="Fill" Stroke="Black" StrokeThickness="0" VerticalAlignment="Top" HorizontalAlignment="Right" Width="12.29" >
  360. <Path.Fill>
  361. <LinearGradientBrush EndPoint="0.466,2.201" StartPoint="0.5,0">
  362. <GradientStop Color="#C66A6A6A" Offset="1"/>
  363. <GradientStop Color="#E1434343" Offset="0.855"/>
  364. <GradientStop Color="#FFC6C6C6" Offset="0.11"/>
  365. </LinearGradientBrush>
  366. </Path.Fill>
  367. <Path.RenderTransform>
  368. <TransformGroup>
  369. <ScaleTransform/>
  370. <SkewTransform/>
  371. <RotateTransform Angle="90.087"/>
  372. <TranslateTransform Y="-6.04399277075815" X="6.0531771644038841"/>
  373. </TransformGroup>
  374. </Path.RenderTransform>
  375. </Path>
  376. <Border BorderBrush="Black" BorderThickness="0" Margin="0,8.061,0,0" CornerRadius="16,0,0,16" Background="White">
  377. <Border.Effect>
  378. <DropShadowEffect Direction="195" BlurRadius="10" Opacity="0.305" ShadowDepth="6"/>
  379. </Border.Effect>
  380. <Border x:Name="contentBorder" BorderBrush="Black" Margin="6,6,0,6" CornerRadius="16,0,0,16">
  381. <Border.Background>
  382. <LinearGradientBrush EndPoint="1.002,0.498" StartPoint="-0.024,0.502">
  383. <GradientStop Color=" #4682B4" Offset="0.027"/>
  384. <GradientStop Color=" #F0FFFF" Offset="0.994"/>
  385. </LinearGradientBrush>
  386. </Border.Background>
  387. <Grid>
  388. <ContentControl HorizontalAlignment="Left" Margin="20,0,23,0" VerticalAlignment="Center" Foreground="White">
  389. <ContentPresenter ContentSource="Header" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" HorizontalAlignment="Stretch" VerticalAlignment="Center" Margin="0" Width="212.323"/>
  390. </ContentControl>
  391. </Grid>
  392. </Border>
  393. </Border>
  394. </Grid>
  395. </Grid>
  396. </ControlTemplate>
  397. </Setter.Value>
  398. </Setter>
  399. </Style>
  400. <!--Combox-->
  401. <Style TargetType="{x:Type ComboBox}" x:Key="cmbstyle">
  402. <Setter Property="Background" Value="White"/>
  403. <Setter Property="ItemContainerStyle">
  404. <Setter.Value>
  405. <!--ComBoxItem-->
  406. <Style TargetType="ComboBoxItem">
  407. <Setter Property="MinHeight" Value="22"></Setter>
  408. <Setter Property="MinWidth" Value="60"></Setter>
  409. <Setter Property="Template">
  410. <Setter.Value>
  411. <ControlTemplate TargetType="ComboBoxItem">
  412. <Border Name="Back" Background="Transparent" BorderThickness="0,0,0,0" BorderBrush="#81D779" Height="{TemplateBinding Height}" >
  413. <ContentPresenter VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5,0,0,0"></ContentPresenter>
  414. </Border>
  415. <ControlTemplate.Triggers>
  416. <Trigger Property="IsMouseOver" Value="True">
  417. <Setter TargetName="Back" Property="Background" Value="LightGray"></Setter>
  418. </Trigger>
  419. <Trigger Property="IsHighlighted" Value="True">
  420. <Setter TargetName="Back" Property="Background" Value="LightGray"></Setter>
  421. </Trigger>
  422. </ControlTemplate.Triggers>
  423. </ControlTemplate>
  424. </Setter.Value>
  425. </Setter>
  426. </Style>
  427. </Setter.Value>
  428. </Setter>
  429. <Setter Property="Template">
  430. <Setter.Value>
  431. <ControlTemplate TargetType="{x:Type ComboBox}">
  432. <Border BorderThickness="1" BorderBrush="#CDC9C9 " CornerRadius="3" Height="{TemplateBinding Height}" Width="{TemplateBinding Width}" Background="{TemplateBinding Background}" >
  433. <Grid Height="{TemplateBinding Height}">
  434. <Grid.ColumnDefinitions>
  435. <ColumnDefinition Width="3*"/>
  436. <ColumnDefinition Width="*"/>
  437. </Grid.ColumnDefinitions>
  438. <Grid Grid.Column="0" x:Name="grid" >
  439. <ToggleButton
  440. Width="{Binding ElementName=grid,Path=ActualWidth}"
  441. Height="{Binding ElementName=grid, Path=ActualHeight}"
  442. Content="{TemplateBinding Text}" VerticalAlignment="Center"
  443. HorizontalAlignment="Left" Margin="5,0,0,0"
  444. BorderThickness="0"
  445. Foreground="{TemplateBinding Foreground}"
  446. Background="{TemplateBinding Background}"
  447. IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" ClickMode="Press"
  448. >
  449. <ToggleButton.Style >
  450. <Style TargetType="ToggleButton">
  451. <Setter Property="Background" Value="White"/>
  452. <Setter Property="Template">
  453. <Setter.Value>
  454. <ControlTemplate TargetType="ToggleButton">
  455. <Border Background="{TemplateBinding Background}" BorderThickness="0" >
  456. <TextBlock Foreground="{TemplateBinding Foreground}" Text="{TemplateBinding Content}" Margin="4 0 0 0" HorizontalAlignment="Left" VerticalAlignment="Center"/>
  457. </Border>
  458. </ControlTemplate>
  459. </Setter.Value>
  460. </Setter>
  461. <Style.Triggers>
  462. <Trigger Property="IsMouseOver" Value="True">
  463. <Setter Property="Background" Value="White"/>
  464. </Trigger>
  465. <Trigger Property="IsMouseOver" Value="False">
  466. <Setter Property="Background" Value="White"/>
  467. </Trigger>
  468. </Style.Triggers>
  469. </Style>
  470. </ToggleButton.Style>
  471. </ToggleButton>
  472. </Grid>
  473. <Grid Grid.Column="1" >
  474. <ToggleButton IsChecked="{Binding Path=IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
  475. Foreground="{TemplateBinding Foreground}"
  476. ClickMode="Press">
  477. <ToggleButton.Style>
  478. <Style TargetType="ToggleButton">
  479. <Setter Property="Background" Value="White"/>
  480. <Setter Property="Template">
  481. <Setter.Value>
  482. <ControlTemplate TargetType="ToggleButton">
  483. <Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}">
  484. <Grid>
  485. <TextBlock Foreground="{TemplateBinding Foreground}" x:Name="arrow_tb" Text="&#xf02a9;" FontFamily="/BPASmartClient.CustomResource;component/Fonts/MT/#iconfont" HorizontalAlignment="Center" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5">
  486. <TextBlock.RenderTransform>
  487. <TransformGroup>
  488. <ScaleTransform/>
  489. <SkewTransform/>
  490. <RotateTransform/>
  491. <TranslateTransform/>
  492. </TransformGroup>
  493. </TextBlock.RenderTransform>
  494. </TextBlock>
  495. </Grid>
  496. </Border>
  497. <ControlTemplate.Triggers>
  498. <Trigger Property="IsChecked" Value="True">
  499. </Trigger>
  500. <EventTrigger RoutedEvent="Checked">
  501. <BeginStoryboard>
  502. <Storyboard >
  503. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow_tb" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
  504. <EasingDoubleKeyFrame KeyTime="00:00:00" Value="0"/>
  505. <EasingDoubleKeyFrame KeyTime="00:00:00.2000000" Value="180"/>
  506. </DoubleAnimationUsingKeyFrames>
  507. </Storyboard>
  508. </BeginStoryboard>
  509. </EventTrigger>
  510. <EventTrigger RoutedEvent="Unchecked">
  511. <BeginStoryboard>
  512. <Storyboard >
  513. <DoubleAnimationUsingKeyFrames Storyboard.TargetName="arrow_tb" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
  514. <EasingDoubleKeyFrame KeyTime="00:00:00" Value="180"/>
  515. <EasingDoubleKeyFrame KeyTime="00:00:00.2000000" Value="0"/>
  516. </DoubleAnimationUsingKeyFrames>
  517. </Storyboard>
  518. </BeginStoryboard>
  519. </EventTrigger>
  520. </ControlTemplate.Triggers>
  521. </ControlTemplate>
  522. </Setter.Value>
  523. </Setter>
  524. </Style>
  525. </ToggleButton.Style>
  526. </ToggleButton>
  527. </Grid>
  528. <Popup IsOpen="{TemplateBinding IsDropDownOpen}" Placement="Bottom" x:Name="Popup" Focusable="False" AllowsTransparency="True" PopupAnimation="Slide">
  529. <Border CornerRadius="1" MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{TemplateBinding ActualWidth}" x:Name="DropDown" SnapsToDevicePixels="True">
  530. <Border.Effect>
  531. <DropShadowEffect Color="Black" BlurRadius="2" ShadowDepth="0" Opacity="0.5"/>
  532. </Border.Effect>
  533. <ScrollViewer Margin="4,6,4,6" MaxHeight="{TemplateBinding MaxDropDownHeight}" SnapsToDevicePixels="True" HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto" CanContentScroll="True">
  534. <!-- StackPanel 用于显示子级,方法是将 IsItemsHost 设置为 True -->
  535. <StackPanel IsItemsHost="True" KeyboardNavigation.DirectionalNavigation="Contained" Background="White"/>
  536. </ScrollViewer>
  537. </Border>
  538. </Popup>
  539. </Grid>
  540. <Border.Effect>
  541. <DropShadowEffect ShadowDepth="-1" Opacity="0.3" Color="#FF969696" BlurRadius="5"/>
  542. </Border.Effect>
  543. </Border>
  544. </ControlTemplate>
  545. </Setter.Value>
  546. </Setter>
  547. </Style>
  548. <!--开关按钮-->
  549. <Style x:Key="OpenCheckBoxStyle1" TargetType="{x:Type CheckBox}">
  550. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}"/>
  551. <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
  552. <Setter Property="Template">
  553. <Setter.Value>
  554. <ControlTemplate TargetType="{x:Type CheckBox}">
  555. <ControlTemplate.Resources>
  556. <Storyboard x:Key="OnChecking">
  557. <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="slider" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
  558. <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="45"/>
  559. </DoubleAnimationUsingKeyFrames>
  560. </Storyboard>
  561. <Storyboard x:Key="OnUnchecking">
  562. <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="slider" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
  563. <SplineDoubleKeyFrame KeyTime="00:00:00.3000000" Value="0"/>
  564. </DoubleAnimationUsingKeyFrames>
  565. <ThicknessAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="slider" Storyboard.TargetProperty="(FrameworkElement.Margin)">
  566. <SplineThicknessKeyFrame KeyTime="00:00:00.3000000" Value="1,1,1,1"/>
  567. </ThicknessAnimationUsingKeyFrames>
  568. </Storyboard>
  569. </ControlTemplate.Resources>
  570. <DockPanel x:Name="dockPanel">
  571. <ContentPresenter SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" ContentTemplate="{TemplateBinding ContentTemplate}" RecognizesAccessKey="True" VerticalAlignment="Center"/>
  572. <Grid Margin="5,5,0,5" Width="80" Background="#FFC0CCD9">
  573. <TextBlock Text="OFF" TextWrapping="Wrap" FontWeight="Bold" FontSize="16" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,3,0" Foreground="Red"/>
  574. <TextBlock HorizontalAlignment="Left" Margin="2,0,0,0" FontSize="16" FontWeight="Bold" Text="ON" VerticalAlignment="Center" TextWrapping="Wrap" Foreground="#008000"/>
  575. <Border HorizontalAlignment="Left" x:Name="slider" Width="33" BorderThickness="1,1,1,1" CornerRadius="3,3,3,3" RenderTransformOrigin="0.5,0.5" Margin="1,1,1,1">
  576. <Border.RenderTransform>
  577. <TransformGroup>
  578. <ScaleTransform ScaleX="1" ScaleY="1"/>
  579. <SkewTransform AngleX="0" AngleY="0"/>
  580. <RotateTransform Angle="0"/>
  581. <TranslateTransform X="0" Y="0"/>
  582. </TransformGroup>
  583. </Border.RenderTransform>
  584. <Border.BorderBrush>
  585. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  586. <GradientStop Color="#FFFFFFFF" Offset="0"/>
  587. <GradientStop Color="#FF4490FF" Offset="1"/>
  588. </LinearGradientBrush>
  589. </Border.BorderBrush>
  590. <Border.Background>
  591. <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
  592. <GradientStop Color="#FF8AB4FF" Offset="1"/>
  593. <GradientStop Color="#FFD1E2FF" Offset="0"/>
  594. </LinearGradientBrush>
  595. </Border.Background>
  596. </Border>
  597. </Grid>
  598. </DockPanel>
  599. <ControlTemplate.Triggers>
  600. <Trigger Property="IsChecked" Value="True">
  601. <Trigger.ExitActions>
  602. <BeginStoryboard Storyboard="{StaticResource OnUnchecking}" x:Name="OnUnchecking_BeginStoryboard"/>
  603. </Trigger.ExitActions>
  604. <Trigger.EnterActions>
  605. <BeginStoryboard Storyboard="{StaticResource OnChecking}" x:Name="OnChecking_BeginStoryboard"/>
  606. </Trigger.EnterActions>
  607. </Trigger>
  608. <Trigger Property="IsEnabled" Value="False">
  609. <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
  610. </Trigger>
  611. </ControlTemplate.Triggers>
  612. </ControlTemplate>
  613. </Setter.Value>
  614. </Setter>
  615. </Style>
  616. <Storyboard x:Key="Move0">
  617. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"
  618. Storyboard.TargetName="contentRegion">
  619. <EasingDoubleKeyFrame KeyTime="0:0:0" Value="900">
  620. </EasingDoubleKeyFrame>
  621. <EasingDoubleKeyFrame KeyTime="0:0:0.5" Value="0">
  622. </EasingDoubleKeyFrame>
  623. </DoubleAnimationUsingKeyFrames>
  624. </Storyboard>
  625. <Storyboard x:Key="Move1">
  626. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"
  627. Storyboard.TargetName="contentRegion">
  628. <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="40">
  629. <EasingDoubleKeyFrame.EasingFunction>
  630. <BackEase EasingMode="EaseInOut"/>
  631. </EasingDoubleKeyFrame.EasingFunction>
  632. </EasingDoubleKeyFrame>
  633. </DoubleAnimationUsingKeyFrames>
  634. </Storyboard>
  635. <Storyboard x:Key="Move2">
  636. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"
  637. Storyboard.TargetName="contentRegion">
  638. <EasingDoubleKeyFrame KeyTime="0:0:0.4" Value="80">
  639. <EasingDoubleKeyFrame.EasingFunction>
  640. <BackEase EasingMode="EaseInOut"/>
  641. </EasingDoubleKeyFrame.EasingFunction>
  642. </EasingDoubleKeyFrame>
  643. </DoubleAnimationUsingKeyFrames>
  644. </Storyboard>
  645. <Style TargetType="TextBlock">
  646. <Setter Property="FontSize" Value="18"/>
  647. <Setter Property="Foreground" Value="DarkSlateGray"/>
  648. <Setter Property="VerticalAlignment" Value="Center"/>
  649. <Setter Property="HorizontalAlignment" Value="Center"/>
  650. <Setter Property="FontSize" Value="18"/>
  651. </Style>
  652. </Application.Resources>
  653. </Application>