终端一体化运控平台
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 

801 lines
40 KiB

  1. <ResourceDictionary
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:con="clr-namespace:BeDesignerSCADA.Converters"
  5. xmlns:ctrl="clr-namespace:BeDesignerSCADA.CustomerControls"
  6. xmlns:dxmvmm="clr-namespace:BeDesignerSCADA.Converters"
  7. xmlns:icon="http://metro.mahapps.com/winfx/xaml/iconpacks"
  8. xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore">
  9. <!--#region 主题笔刷-->
  10. <LinearGradientBrush x:Key="NormalBackground" StartPoint="0.5,0" EndPoint="0.5,1">
  11. <GradientStopCollection>
  12. <GradientStop Color="White" />
  13. <GradientStop Offset="0.5" Color="#D0D0D0" />
  14. <GradientStop Offset="1" Color="#E3E3E3" />
  15. </GradientStopCollection>
  16. </LinearGradientBrush>
  17. <SolidColorBrush x:Key="AccentBrush" Color="#2B79E2" />
  18. <SolidColorBrush x:Key="ControlBorderBrush" Color="LightGray" />
  19. <SolidColorBrush x:Key="ControlBackground" Color="White" />
  20. <SolidColorBrush x:Key="ControlForeground" Color="Black" />
  21. <!--#endregion-->
  22. <!--#region 转换器-->
  23. <con:HalfNumberConverter x:Key="HalfNumber" />
  24. <!--#endregion-->
  25. <!--#region 编辑模板-->
  26. <DataTemplate x:Key="EventEditTemplate">
  27. <DockPanel Height="24">
  28. <Button
  29. Margin="2"
  30. Command="{Binding DataContext.EditCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
  31. CommandParameter="{Binding .}"
  32. Content="..."
  33. DockPanel.Dock="Right" />
  34. <TextBlock
  35. Margin="4,0,0,0"
  36. VerticalAlignment="Center"
  37. Text="{Binding Value}" />
  38. </DockPanel>
  39. </DataTemplate>
  40. <DataTemplate x:Key="ListEditTemplate">
  41. <DockPanel MaxHeight="100">
  42. <DockPanel DockPanel.Dock="Top">
  43. <Button
  44. Margin="2"
  45. Padding="2"
  46. Command="{Binding Value.AddCommand}"
  47. CommandParameter="{Binding ElementName=AddTxt, Path=Text}"
  48. DockPanel.Dock="Right">
  49. <icon:PackIconModern Kind="EditAdd" />
  50. </Button>
  51. <Button
  52. Margin="2"
  53. Padding="2"
  54. Command="{Binding Value.DeleteCommand}"
  55. CommandParameter="{Binding ElementName=list, Path=SelectedItem}"
  56. DockPanel.Dock="Right">
  57. <icon:PackIconModern Kind="Delete" />
  58. </Button>
  59. <TextBox x:Name="AddTxt" Margin="2" />
  60. </DockPanel>
  61. <ListBox
  62. x:Name="list"
  63. Margin="2"
  64. ItemsSource="{Binding Value}" />
  65. </DockPanel>
  66. </DataTemplate>
  67. <DataTemplate x:Key="ImagePathEditTemplate">
  68. <DockPanel>
  69. <Button
  70. Width="20"
  71. Height="20"
  72. Margin="2"
  73. Padding="0"
  74. Command="{Binding DataContext.SelectPathCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
  75. CommandParameter="{Binding .}"
  76. Content="..."
  77. DockPanel.Dock="Right" />
  78. <TextBox
  79. x:Name="AddTxt"
  80. BorderThickness="0"
  81. DockPanel.Dock="Right"
  82. Text="{Binding Value}" />
  83. </DockPanel>
  84. </DataTemplate>
  85. <!--#endregion-->
  86. <!--#region 为某些获取焦点的控件设计设计时样式-->
  87. <Style x:Key="DesignComboBox" TargetType="ComboBox">
  88. <Setter Property="Focusable" Value="False" />
  89. <Setter Property="Template">
  90. <Setter.Value>
  91. <ControlTemplate TargetType="ComboBox">
  92. <Border BorderBrush="{StaticResource ControlBorderBrush}" BorderThickness="1">
  93. <Grid>
  94. <Grid.ColumnDefinitions>
  95. <ColumnDefinition />
  96. <ColumnDefinition Width="auto" />
  97. </Grid.ColumnDefinitions>
  98. <Border Background="{StaticResource ControlBackground}" />
  99. <Border
  100. Grid.Column="1"
  101. Background="{StaticResource ControlBackground}"
  102. BorderThickness="0"
  103. IsEnabled="False">
  104. <Path
  105. Margin="3"
  106. VerticalAlignment="Center"
  107. Data="M0,0 8,0 4,4z"
  108. Fill="{StaticResource ControlForeground}" />
  109. </Border>
  110. </Grid>
  111. </Border>
  112. </ControlTemplate>
  113. </Setter.Value>
  114. </Setter>
  115. </Style>
  116. <!--<Style TargetType="Button" x:Key="DesignButton">
  117. <Setter Property="Template">
  118. <Setter.Value>
  119. <ControlTemplate TargetType="Button">
  120. <Border BorderThickness="1" BorderBrush="{StaticResource ControlBorderBrush}" Background="{StaticResource ControlBackground}">
  121. <TextBlock Text="{TemplateBinding Content}" FontSize="{TemplateBinding FontSize}"
  122. FontWeight="{TemplateBinding FontWeight}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  123. </Border>
  124. </ControlTemplate>
  125. </Setter.Value>
  126. </Setter>
  127. </Style>-->
  128. <Style x:Key="DesignToggleButton" TargetType="ToggleButton">
  129. <Setter Property="Foreground" Value="{StaticResource ControlForeground}" />
  130. <Setter Property="Template">
  131. <Setter.Value>
  132. <ControlTemplate TargetType="ToggleButton">
  133. <Border
  134. Background="{StaticResource NormalBackground}"
  135. BorderBrush="{StaticResource ControlBorderBrush}"
  136. BorderThickness="1"
  137. CornerRadius="2">
  138. <TextBlock
  139. HorizontalAlignment="Center"
  140. VerticalAlignment="Center"
  141. FontSize="{TemplateBinding FontSize}"
  142. FontWeight="{TemplateBinding FontWeight}"
  143. Text="{TemplateBinding Content}" />
  144. </Border>
  145. </ControlTemplate>
  146. </Setter.Value>
  147. </Setter>
  148. </Style>
  149. <Style x:Key="ExecuteToggleButton" TargetType="ToggleButton">
  150. <Setter Property="Foreground" Value="{StaticResource ControlForeground}" />
  151. <Setter Property="Foreground" Value="{StaticResource ControlForeground}" />
  152. <Setter Property="Template">
  153. <Setter.Value>
  154. <ControlTemplate TargetType="ToggleButton">
  155. <Border
  156. x:Name="bd"
  157. Background="{StaticResource NormalBackground}"
  158. BorderBrush="{StaticResource ControlBorderBrush}"
  159. BorderThickness="1"
  160. CornerRadius="2">
  161. <TextBlock
  162. HorizontalAlignment="Center"
  163. VerticalAlignment="Center"
  164. FontSize="{TemplateBinding FontSize}"
  165. FontWeight="{TemplateBinding FontWeight}"
  166. Text="{TemplateBinding Content}" />
  167. </Border>
  168. <ControlTemplate.Triggers>
  169. <Trigger Property="IsChecked" Value="True">
  170. <Setter TargetName="bd" Property="Background">
  171. <Setter.Value>
  172. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  173. <GradientStopCollection>
  174. <GradientStop Color="#6AD456" />
  175. <GradientStop Offset="0.5" Color="#1DAE06" />
  176. <GradientStop Offset="1" Color="#8BDC7C" />
  177. </GradientStopCollection>
  178. </LinearGradientBrush>
  179. </Setter.Value>
  180. </Setter>
  181. </Trigger>
  182. </ControlTemplate.Triggers>
  183. </ControlTemplate>
  184. </Setter.Value>
  185. </Setter>
  186. </Style>
  187. <!--#endregion-->
  188. <DataTemplate x:Key="ToolBoxStyle">
  189. <Grid Margin="2" Background="Transparent">
  190. <Grid.ColumnDefinitions>
  191. <ColumnDefinition Width="30" />
  192. <ColumnDefinition />
  193. </Grid.ColumnDefinitions>
  194. <icon:PackIconMaterial
  195. x:Name="icon"
  196. Width="24"
  197. HorizontalAlignment="Stretch"
  198. VerticalAlignment="Stretch"
  199. BorderThickness="1"
  200. Kind="Ellipse" />
  201. <TextBlock
  202. x:Name="txt"
  203. Grid.Column="1"
  204. Margin="4"
  205. Text="{Binding Name}" />
  206. </Grid>
  207. <DataTemplate.Triggers>
  208. <DataTrigger Binding="{Binding Name}" Value="TheButton">
  209. <Setter TargetName="icon" Property="Kind" Value="GestureTapButton" />
  210. <Setter TargetName="txt" Property="Text" Value="按钮" />
  211. </DataTrigger>
  212. <DataTrigger Binding="{Binding Name}" Value="TheTimer">
  213. <Setter TargetName="icon" Property="Kind" Value="Timer" />
  214. <Setter TargetName="txt" Property="Text" Value="计时器" />
  215. </DataTrigger>
  216. <DataTrigger Binding="{Binding Name}" Value="TheCheckBox">
  217. <Setter TargetName="icon" Property="Kind" Value="CheckboxMarked" />
  218. <Setter TargetName="txt" Property="Text" Value="勾选框" />
  219. </DataTrigger>
  220. <DataTrigger Binding="{Binding Name}" Value="DigitalNumber">
  221. <Setter TargetName="icon" Property="Kind" Value="LedStrip" />
  222. <Setter TargetName="txt" Property="Text" Value="液晶数字" />
  223. </DataTrigger>
  224. <DataTrigger Binding="{Binding Name}" Value="TheComboBox">
  225. <Setter TargetName="icon" Property="Kind" Value="ViewList" />
  226. <Setter TargetName="txt" Property="Text" Value="下拉框" />
  227. </DataTrigger>
  228. <DataTrigger Binding="{Binding Name}" Value="TheImage">
  229. <Setter TargetName="icon" Property="Kind" Value="Image" />
  230. <Setter TargetName="txt" Property="Text" Value="图片" />
  231. </DataTrigger>
  232. <DataTrigger Binding="{Binding Name}" Value="TheTextBlock">
  233. <Setter TargetName="icon" Property="Kind" Value="TagText" />
  234. <Setter TargetName="txt" Property="Text" Value="文本块" />
  235. </DataTrigger>
  236. <DataTrigger Binding="{Binding Name}" Value="ArcGauge">
  237. <Setter TargetName="icon" Property="Kind" Value="Gauge" />
  238. <Setter TargetName="txt" Property="Text" Value="仪表盘" />
  239. </DataTrigger>
  240. <DataTrigger Binding="{Binding Name}" Value="StatusLight">
  241. <Setter TargetName="icon" Property="Kind" Value="CeilingLight" />
  242. <Setter TargetName="txt" Property="Text" Value="状态灯" />
  243. </DataTrigger>
  244. <DataTrigger Binding="{Binding Name}" Value="TheToggleButton">
  245. <Setter TargetName="icon" Property="Kind" Value="CheckOutline" />
  246. <Setter TargetName="txt" Property="Text" Value="开关按钮" />
  247. </DataTrigger>
  248. <DataTrigger Binding="{Binding Name}" Value="TheGroupBox">
  249. <Setter TargetName="icon" Property="Kind" Value="Group" />
  250. <Setter TargetName="txt" Property="Text" Value="分组" />
  251. </DataTrigger>
  252. <DataTrigger Binding="{Binding Name}" Value="TheTextBox">
  253. <Setter TargetName="icon" Property="Kind" Value="TextBox" />
  254. <Setter TargetName="txt" Property="Text" Value="文本框" />
  255. </DataTrigger>
  256. <DataTrigger Binding="{Binding Name}" Value="NumberBox">
  257. <Setter TargetName="icon" Property="Kind" Value="Numeric8Box" />
  258. <Setter TargetName="txt" Property="Text" Value="数值框" />
  259. </DataTrigger>
  260. <DataTrigger Binding="{Binding Name}" Value="GraphArrow">
  261. <Setter TargetName="icon" Property="Kind" Value="ArrowRightBold" />
  262. <Setter TargetName="txt" Property="Text" Value="箭头" />
  263. </DataTrigger>
  264. <DataTrigger Binding="{Binding Name}" Value="GraphStar">
  265. <Setter TargetName="icon" Property="Kind" Value="Star" />
  266. <Setter TargetName="txt" Property="Text" Value="五角星" />
  267. </DataTrigger>
  268. <DataTrigger Binding="{Binding Name}" Value="TheSlider">
  269. <Setter TargetName="icon" Property="Kind" Value="ArrowDownBold" />
  270. <Setter TargetName="txt" Property="Text" Value="滑块" />
  271. </DataTrigger>
  272. <DataTrigger Binding="{Binding Name}" Value="TheRadioButton">
  273. <Setter TargetName="icon" Property="Kind" Value="RadioboxMarked" />
  274. <Setter TargetName="txt" Property="Text" Value="单选按钮" />
  275. </DataTrigger>
  276. <DataTrigger Binding="{Binding Name}" Value="SwitchButton">
  277. <Setter TargetName="icon" Property="Kind" Value="ToggleSwitch" />
  278. <Setter TargetName="txt" Property="Text" Value="开关" />
  279. </DataTrigger>
  280. <DataTrigger Binding="{Binding Name}" Value="KnobButton">
  281. <Setter TargetName="icon" Property="Kind" Value="Ellipse" />
  282. <Setter TargetName="txt" Property="Text" Value="旋钮" />
  283. </DataTrigger>
  284. <DataTrigger Binding="{Binding Name}" Value="Silos">
  285. <Setter TargetName="icon" Property="Kind" Value="StoreSettings" />
  286. <Setter TargetName="txt" Property="Text" Value="物料仓" />
  287. </DataTrigger>
  288. <DataTrigger Binding="{Binding Name}" Value="NewConveyorBelt">
  289. <Setter TargetName="icon" Property="Kind" Value="Attachment" />
  290. <Setter TargetName="txt" Property="Text" Value="滚动线" />
  291. </DataTrigger>
  292. <DataTrigger Binding="{Binding Name}" Value="TheDataGrid">
  293. <Setter TargetName="icon" Property="Kind" Value="BorderAll" />
  294. <Setter TargetName="txt" Property="Text" Value="表格" />
  295. </DataTrigger>
  296. <DataTrigger Binding="{Binding Name}" Value="TheListBox">
  297. <Setter TargetName="icon" Property="Kind" Value="ViewHeadline" />
  298. <Setter TargetName="txt" Property="Text" Value="列表控件" />
  299. </DataTrigger>
  300. <DataTrigger Binding="{Binding Name}" Value="TheRedis">
  301. <Setter TargetName="icon" Property="Kind" Value="AlphaDBoxOutline" />
  302. <Setter TargetName="txt" Property="Text" Value="Redis控件" />
  303. </DataTrigger>
  304. <DataTrigger Binding="{Binding Name}" Value="WaveProgressBar">
  305. <Setter TargetName="icon" Property="Kind" Value="Wave" />
  306. <Setter TargetName="txt" Property="Text" Value="进度条波浪" />
  307. </DataTrigger>
  308. <DataTrigger Binding="{Binding Name}" Value="TheProgressBar">
  309. <Setter TargetName="icon" Property="Kind" Value="Texture" />
  310. <Setter TargetName="txt" Property="Text" Value="进度条正常" />
  311. </DataTrigger>
  312. <DataTrigger Binding="{Binding Name}" Value="TheRedProgressBar">
  313. <Setter TargetName="icon" Property="Kind" Value="CircleSlice5" />
  314. <Setter TargetName="txt" Property="Text" Value="进度条圆形红" />
  315. </DataTrigger>
  316. <DataTrigger Binding="{Binding Name}" Value="TheBlueProgressBar">
  317. <Setter TargetName="icon" Property="Kind" Value="CircleSlice5" />
  318. <Setter TargetName="txt" Property="Text" Value="进度条圆形蓝" />
  319. </DataTrigger>
  320. <DataTrigger Binding="{Binding Name}" Value="TheGreenProgressBar">
  321. <Setter TargetName="icon" Property="Kind" Value="CircleSlice5" />
  322. <Setter TargetName="txt" Property="Text" Value="进度条圆形绿" />
  323. </DataTrigger>
  324. <DataTrigger Binding="{Binding Name}" Value="TheAPI">
  325. <Setter TargetName="icon" Property="Kind" Value="AlphaABoxOutline" />
  326. <Setter TargetName="txt" Property="Text" Value="API接口" />
  327. </DataTrigger>
  328. <DataTrigger Binding="{Binding Name}" Value="TheMQTT">
  329. <Setter TargetName="icon" Property="Kind" Value="AlphaMBoxOutline" />
  330. <Setter TargetName="txt" Property="Text" Value="MQTT" />
  331. </DataTrigger>
  332. <DataTrigger Binding="{Binding Name}" Value="TheTabControl">
  333. <Setter TargetName="icon" Property="Kind" Value="PeriodicTable" />
  334. <Setter TargetName="txt" Property="Text" Value="选项卡控件" />
  335. </DataTrigger>
  336. </DataTemplate.Triggers>
  337. </DataTemplate>
  338. <FontFamily x:Key="Digital">
  339. pack://application:,,,/Fonts/#DS-Digital
  340. </FontFamily>
  341. <!--#region 右键菜单-->
  342. <ContextMenu
  343. x:Key="CanvasRightMenu"
  344. DataContext="{Binding PlacementTarget, RelativeSource={RelativeSource Self}}"
  345. FontFamily="Microsoft YaHei Ui">
  346. <MenuItem Command="{Binding CopySelectItemsCommand}" Header="复制">
  347. <MenuItem.Icon>
  348. <icon:PackIconModern
  349. Width="10"
  350. HorizontalAlignment="Center"
  351. Kind="PageCopy" />
  352. </MenuItem.Icon>
  353. </MenuItem>
  354. <MenuItem Command="{Binding PasteSelectItemsCommand}" Header="粘贴">
  355. <MenuItem.Icon>
  356. <icon:PackIconModern
  357. Width="10"
  358. HorizontalAlignment="Center"
  359. Kind="ClipboardPaste" />
  360. </MenuItem.Icon>
  361. </MenuItem>
  362. <MenuItem Command="{Binding DeleteSelectItemsCommand}" Header="删除">
  363. <MenuItem.Icon>
  364. <icon:PackIconModern
  365. Width="10"
  366. HorizontalAlignment="Center"
  367. Kind="Delete" />
  368. </MenuItem.Icon>
  369. </MenuItem>
  370. </ContextMenu>
  371. <ContextMenu
  372. x:Key="AdornerRightMenu"
  373. DataContext="{Binding PlacementTarget.Tag, RelativeSource={RelativeSource Mode=Self}}"
  374. FontFamily="Microsoft YaHei Ui">
  375. <MenuItem Command="{Binding CopySelectItemsCommand}" Header="复制">
  376. <MenuItem.Icon>
  377. <icon:PackIconModern
  378. Width="10"
  379. HorizontalAlignment="Center"
  380. Kind="PageCopy" />
  381. </MenuItem.Icon>
  382. </MenuItem>
  383. <MenuItem Command="{Binding PasteSelectItemsCommand}" Header="粘贴">
  384. <MenuItem.Icon>
  385. <icon:PackIconModern
  386. Width="10"
  387. HorizontalAlignment="Center"
  388. Kind="ClipboardPaste" />
  389. </MenuItem.Icon>
  390. </MenuItem>
  391. <MenuItem Command="{Binding DeleteSelectItemsCommand}" Header="删除">
  392. <MenuItem.Icon>
  393. <icon:PackIconModern
  394. Width="10"
  395. HorizontalAlignment="Center"
  396. Kind="Delete" />
  397. </MenuItem.Icon>
  398. </MenuItem>
  399. <MenuItem Command="{Binding SetTopLayerCommand}" Header="置于顶层">
  400. <MenuItem.Icon>
  401. <icon:PackIconMaterial
  402. Width="10"
  403. HorizontalAlignment="Center"
  404. Kind="ArrangeSendToBack" />
  405. </MenuItem.Icon>
  406. </MenuItem>
  407. <MenuItem Command="{Binding SetBottomLayerCommand}" Header="置于底层">
  408. <MenuItem.Icon>
  409. <icon:PackIconMaterial
  410. Width="10"
  411. HorizontalAlignment="Center"
  412. Kind="ArrangeBringToFront" />
  413. </MenuItem.Icon>
  414. </MenuItem>
  415. </ContextMenu>
  416. <!--#endregion-->
  417. <!--#region 控件集合-->
  418. <!--<Style TargetType="ctrl:DigitalNumber">
  419. <Setter Property="Background" Value="#FF1A1E22"/>
  420. <Setter Property="Foreground" Value="#FF0AA74D"/>
  421. <Setter Property="NumberValue" Value="0.01"/>
  422. <Setter Property="FontSize" Value="20"/>
  423. <Setter Property="Template">
  424. <Setter.Value>
  425. <ControlTemplate TargetType="ctrl:DigitalNumber">
  426. <Grid Background="{TemplateBinding Background}">
  427. <TextBlock x:Name="line" VerticalAlignment="Center" HorizontalAlignment="Center"
  428. FontFamily="{StaticResource Digital}" FontSize="{TemplateBinding FontSize}"
  429. Text="{Binding NumberValue,RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=ctrl:DigitalNumber},Mode=TwoWay}"
  430. Foreground="{TemplateBinding Foreground}"/>
  431. </Grid>
  432. </ControlTemplate>
  433. </Setter.Value>
  434. </Setter>
  435. </Style>
  436. <Style TargetType="{x:Type ctrl:TheTimer}">
  437. <Setter Property="Template">
  438. <Setter.Value>
  439. <ControlTemplate TargetType="{x:Type ctrl:TheTimer}">
  440. <Border Background="{TemplateBinding Background}"
  441. BorderBrush="{TemplateBinding BorderBrush}"
  442. BorderThickness="{TemplateBinding BorderThickness}">
  443. <Grid>
  444. <Image Source="../Images/timericon.png" RenderOptions.BitmapScalingMode="Fant"/>
  445. </Grid>
  446. </Border>
  447. </ControlTemplate>
  448. </Setter.Value>
  449. </Setter>
  450. </Style>
  451. <Style TargetType="{x:Type ctrl:StatusLight}">
  452. <Setter Property="Template">
  453. <Setter.Value>
  454. <ControlTemplate TargetType="{x:Type ctrl:StatusLight}">
  455. <Border Width="{Binding Path=ActualHeight,RelativeSource={RelativeSource Self}}">
  456. <Grid>
  457. <Image x:Name="ima" Source="../Images/State0.png" RenderOptions.BitmapScalingMode="Fant">
  458. </Image>
  459. </Grid>
  460. </Border>
  461. </ControlTemplate>
  462. </Setter.Value>
  463. </Setter>
  464. </Style>
  465. <Style TargetType="{x:Type ctrl:ArcGauge}">
  466. <Setter Property="Background" Value="#646464"/>
  467. <Setter Property="Foreground" Value="Black"/>
  468. <Setter Property="Template">
  469. <Setter.Value>
  470. <ControlTemplate TargetType="{x:Type ctrl:ArcGauge}">
  471. <Border Margin="10">
  472. <Grid Width="{Binding RelativeSource={RelativeSource Self},Path=ActualHeight}">
  473. <Ellipse Fill="#FF3B3B3B"/>
  474. <Grid RenderTransformOrigin="0.5,0.5" Margin="2">
  475. <Grid.RenderTransform>
  476. <TransformGroup>
  477. <RotateTransform Angle="{Binding Path=Angle,ElementName=PointRotate}"/>
  478. </TransformGroup>
  479. </Grid.RenderTransform>
  480. <Ellipse Width="16" Height="14" Fill="Orange" VerticalAlignment="Top" >
  481. <Ellipse.Effect>
  482. <BlurEffect Radius="12"/>
  483. </Ellipse.Effect>
  484. </Ellipse>
  485. </Grid>
  486. <Grid x:Name="bdGrid" Margin="12" UseLayoutRounding="True" ClipToBounds="True">
  487. <Ellipse>
  488. <Ellipse.Fill>
  489. <RadialGradientBrush>
  490. <GradientStop Color="#4D000000"/>
  491. </RadialGradientBrush>
  492. </Ellipse.Fill>
  493. </Ellipse>
  494. <Grid>
  495. <Grid.ColumnDefinitions>
  496. <ColumnDefinition/>
  497. <ColumnDefinition Width="2*"/>
  498. <ColumnDefinition/>
  499. </Grid.ColumnDefinitions>
  500. <Grid.RowDefinitions>
  501. <RowDefinition/>
  502. <RowDefinition Height="2*"/>
  503. <RowDefinition/>
  504. </Grid.RowDefinitions>
  505. <Ellipse Stroke="#464646" StrokeThickness="1" Grid.Column="1" Grid.Row="1"/>
  506. <Ellipse Stroke="#959595" Margin="4" StrokeThickness="6" Grid.Column="1" Grid.Row="1"/>
  507. <Ellipse Stroke="#464646" Margin="14" StrokeThickness="1" Grid.Column="1" Grid.Row="1"/>
  508. </Grid>
  509. <Grid>
  510. <Grid.RowDefinitions>
  511. <RowDefinition/>
  512. <RowDefinition/>
  513. </Grid.RowDefinitions>
  514. <Path Data="M5,0 5,0 10,120 0,120z" Fill="#0FA9CE" Stretch="Uniform" Margin="0 30 0 0" RenderTransformOrigin="0.5,1" HorizontalAlignment="Center">
  515. <Path.RenderTransform>
  516. <TransformGroup>
  517. <RotateTransform x:Name="PointRotate"/>
  518. </TransformGroup>
  519. </Path.RenderTransform>
  520. </Path>
  521. </Grid>
  522. <Ellipse Width="28" Height="28" Fill="Black">
  523. <Ellipse.Effect>
  524. <DropShadowEffect Color="#0FA9CE" ShadowDepth="0" Direction="0" BlurRadius="16"/>
  525. </Ellipse.Effect>
  526. </Ellipse>
  527. <Border VerticalAlignment="Bottom" BorderBrush="#10ABD1" BorderThickness="2" Margin="0 0 0 12" Background="Black" Padding="4 2" HorizontalAlignment="Center">
  528. <TextBlock Text="{Binding Value,RelativeSource={RelativeSource Mode=TemplatedParent},StringFormat={}{0:f1}}" FontSize="16" Width="46" TextAlignment="Center" Foreground="White"/>
  529. </Border>
  530. </Grid>
  531. </Grid>
  532. </Border>
  533. </ControlTemplate>
  534. </Setter.Value>
  535. </Setter>
  536. </Style>
  537. <Style TargetType="{x:Type ctrl:TheTextBox}" BasedOn="{StaticResource {x:Type TextBox}}"/>
  538. <Style x:Key="DesignTheTextBox" TargetType="{x:Type ctrl:TheTextBox}">
  539. <Setter Property="Template">
  540. <Setter.Value>
  541. <ControlTemplate TargetType="ctrl:TheTextBox">
  542. <Border BorderBrush="{StaticResource ControlBorderBrush}" BorderThickness="1" Background="{StaticResource ControlBackground}">
  543. <TextBlock Margin="4 0 0 0" Text="{TemplateBinding Text}" VerticalAlignment="Center"/>
  544. </Border>
  545. </ControlTemplate>
  546. </Setter.Value>
  547. </Setter>
  548. </Style>
  549. <Style TargetType="{x:Type ctrl:NumberBox}" BasedOn="{StaticResource {x:Type TextBox}}">
  550. <Setter Property="input:InputMethod.IsInputMethodEnabled" Value="False"/>
  551. </Style>
  552. <Style x:Key="DesignNumberBox" TargetType="{x:Type ctrl:NumberBox}">
  553. <Setter Property="input:InputMethod.IsInputMethodEnabled" Value="False"/>
  554. <Setter Property="Template">
  555. <Setter.Value>
  556. <ControlTemplate TargetType="ctrl:NumberBox">
  557. <Border BorderBrush="{StaticResource ControlBorderBrush}" BorderThickness="1" Background="{StaticResource ControlBackground}">
  558. <TextBlock Margin="4 0 0 0" Text="{TemplateBinding Text}" VerticalAlignment="Center" Foreground="BlueViolet"/>
  559. </Border>
  560. </ControlTemplate>
  561. </Setter.Value>
  562. </Setter>
  563. </Style>
  564. <Style TargetType="{x:Type ctrl:TheSlider}" BasedOn="{StaticResource {x:Type Slider}}">
  565. <Setter Property="Width" Value="140"/>
  566. <Setter Property="Maximum" Value="100"/>
  567. <Setter Property="IsSnapToTickEnabled" Value="True"/>
  568. <Setter Property="Minimum" Value="0"/>
  569. <Setter Property="AutoToolTipPlacement" Value="BottomRight"/>
  570. <Setter Property="SmallChange" Value="0.1"/>
  571. <Setter Property="LargeChange" Value="0.1"/>
  572. </Style>
  573. <Style TargetType="{x:Type ctrl:TheRadioButton}" BasedOn="{StaticResource {x:Type RadioButton}}">
  574. <Setter Property="VerticalContentAlignment" Value="Center" />
  575. </Style>
  576. <Style TargetType="{x:Type ctrl:WaveProgressBar}">
  577. <Setter Property="BorderBrush" Value="{StaticResource ControlBorderBrush}" />
  578. <Setter Property="BorderThickness" Value="1"/>
  579. <Setter Property="WaveFill" Value="#36E7AE"/>
  580. <Setter Property="WaveThickness" Value="2"/>
  581. <Setter Property="WaveStroke" Value="#3649E7"/>
  582. <Setter Property="ShowText" Value="True" />
  583. <Setter Property="Background" Value="Transparent" />
  584. <Setter Property="Template">
  585. <Setter.Value>
  586. <ControlTemplate TargetType="ctrl:WaveProgressBar">
  587. <ControlTemplate.Resources>
  588. <Storyboard x:Key="StoryboardOnLoaded" RepeatBehavior="Forever">
  589. <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.X)" Storyboard.TargetName="PART_Wave">
  590. <EasingDoubleKeyFrame KeyTime="0:0:2" Value="-400"/>
  591. </DoubleAnimationUsingKeyFrames>
  592. </Storyboard>
  593. </ControlTemplate.Resources>
  594. <StackPanel>
  595. <Border Background="{TemplateBinding Background}">
  596. <Viewbox>
  597. <Border x:Name="PART_Clip" BorderThickness="{TemplateBinding BorderThickness}" ClipToBounds="True"
  598. BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="100" Width="200" Height="200">
  599. <Border.Clip>
  600. <EllipseGeometry RadiusX="100" RadiusY="100" Center="100,100"/>
  601. </Border.Clip>
  602. <Grid>
  603. <Path x:Name="PART_Wave" Stroke="{TemplateBinding WaveStroke}" ClipToBounds="True" StrokeThickness="{TemplateBinding WaveThickness}" HorizontalAlignment="Left" VerticalAlignment="Top" Width="600" Height="250" Fill="{TemplateBinding WaveFill}" Stretch="Fill" RenderTransformOrigin="0.5,0.5" UseLayoutRounding="False" Margin="0,0,-400,-20">
  604. <Path.Data>
  605. <PathGeometry>
  606. <PathFigure StartPoint="0,1">
  607. <PolyBezierSegment Points="0.5,1 0.5,0 1,0"/>
  608. <PolyBezierSegment Points="1.5,0 1.5,1 2,1"/>
  609. <PolyBezierSegment Points="2.5,1 2.5,0 3,0"/>
  610. <PolyLineSegment Points="3,0 3,10, 0,10 0,1"/>
  611. </PathFigure>
  612. </PathGeometry>
  613. </Path.Data>
  614. </Path>
  615. <TextBlock Visibility="{Binding ShowText,RelativeSource={RelativeSource TemplatedParent},Converter={x:Static dxmvmm:BoolToVisibilityConverter.Instance}}"
  616. HorizontalAlignment="Center" VerticalAlignment="Center"
  617. Foreground="{TemplateBinding Foreground}" FontSize="{TemplateBinding FontSize}"
  618. Text="{Binding Value,RelativeSource={RelativeSource Mode=TemplatedParent},StringFormat={}{0:f2}%}"/>
  619. </Grid>
  620. </Border>
  621. </Viewbox>
  622. </Border>
  623. </StackPanel>
  624. <ControlTemplate.Triggers>
  625. <EventTrigger RoutedEvent="FrameworkElement.Loaded" SourceName="PART_Wave">
  626. <BeginStoryboard Name="BeginStoryboardWave" Storyboard="{StaticResource StoryboardOnLoaded}"/>
  627. </EventTrigger>
  628. <EventTrigger RoutedEvent="FrameworkElement.Unloaded" SourceName="PART_Wave">
  629. <StopStoryboard BeginStoryboardName="BeginStoryboardWave"/>
  630. </EventTrigger>
  631. </ControlTemplate.Triggers>
  632. </ControlTemplate>
  633. </Setter.Value>
  634. </Setter>
  635. </Style>
  636. <Style TargetType="{x:Type ctrl:SwitchButton}">
  637. <Setter Property="Background" Value="#00F4D5"/>
  638. <Setter Property="BorderBrush" Value="LightGray"/>
  639. <Setter Property="Template">
  640. <Setter.Value>
  641. <ControlTemplate TargetType="ctrl:SwitchButton">
  642. <Border CornerRadius="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=ActualHeight,Converter={StaticResource HalfNumber}}"
  643. BorderThickness="1" Background="{StaticResource ControlBackground}" BorderBrush="{TemplateBinding BorderBrush}">
  644. <Grid>
  645. <Ellipse x:Name="ELLIPSE" HorizontalAlignment="Left" VerticalAlignment="Center" RenderTransformOrigin="0.5,0.5"
  646. Fill="Gray" Stroke="{StaticResource ControlBorderBrush}" StrokeThickness="1">
  647. <Ellipse.RenderTransform>
  648. <TransformGroup>
  649. <TranslateTransform x:Name="TranslateX" X="2"/>
  650. </TransformGroup>
  651. </Ellipse.RenderTransform>
  652. </Ellipse>
  653. </Grid>
  654. </Border>
  655. </ControlTemplate>
  656. </Setter.Value>
  657. </Setter>
  658. </Style>
  659. <Style TargetType="{x:Type ctrl:KnobButton}">
  660. <Setter Property="Background" Value="#0068F4"/>
  661. <Setter Property="BorderBrush" Value="LightGray"/>
  662. <Setter Property="Foreground" Value="Black"/>
  663. <Setter Property="FontSize" Value="20"/>
  664. <Setter Property="Template">
  665. <Setter.Value>
  666. <ControlTemplate TargetType="ctrl:KnobButton">
  667. <Grid x:Name="bdGrid" Width="{Binding RelativeSource={RelativeSource Self}, Path=ActualHeight}">
  668. <Grid Margin="16" RenderTransformOrigin="0.5,0.5">
  669. <Grid.RenderTransform>
  670. <RotateTransform x:Name="rotatevalue" Angle="00"/>
  671. </Grid.RenderTransform>
  672. <Ellipse Margin="4" Fill="#FFF6F6F6" Stroke="{StaticResource ControlBorderBrush}" >
  673. <Ellipse.Effect>
  674. <DropShadowEffect ShadowDepth="2" BlurRadius="8" Direction="-90" Color="{Binding RelativeSource={RelativeSource Mode=TemplatedParent},Path=Background.(SolidColorBrush.Color)}"/>
  675. </Ellipse.Effect>
  676. </Ellipse>
  677. <Ellipse Margin="12" Fill="{TemplateBinding Background}" Width="8" Height="8" VerticalAlignment="Bottom">
  678. </Ellipse>
  679. </Grid>
  680. <TextBlock Text="{Binding Value,RelativeSource={RelativeSource Mode=TemplatedParent}, StringFormat={}{0:F2}}"
  681. VerticalAlignment="Center" HorizontalAlignment="Center" Foreground="{TemplateBinding Foreground}" FontSize="{TemplateBinding FontSize}"/>
  682. </Grid>
  683. </ControlTemplate>
  684. </Setter.Value>
  685. </Setter>
  686. </Style>-->
  687. <!--#endregion-->
  688. <!--#region 控制集合-->
  689. <Style TargetType="{x:Type ToggleButton}">
  690. <Setter Property="Foreground" Value="White" />
  691. <Setter Property="FontFamily" Value="Microsoft YaHei" />
  692. <Setter Property="FontSize" Value="12" />
  693. <Setter Property="FontWeight" Value="Bold" />
  694. <Setter Property="Template">
  695. <Setter.Value>
  696. <ControlTemplate TargetType="ToggleButton">
  697. <Border
  698. BorderBrush="{TemplateBinding Control.BorderBrush}"
  699. BorderThickness="0"
  700. CornerRadius="2">
  701. <Border.Background>
  702. <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
  703. <GradientStop Offset="0.0" Color="#FF71E0C6" />
  704. <GradientStop Offset="0.2" Color="#FF43A88D" />
  705. <GradientStop Offset="0.0" Color="#FF5BB07D" />
  706. </LinearGradientBrush>
  707. </Border.Background>
  708. <ContentPresenter
  709. HorizontalAlignment="Center"
  710. VerticalAlignment="Center"
  711. Content="{TemplateBinding ContentControl.Content}" />
  712. </Border>
  713. <ControlTemplate.Triggers>
  714. <Trigger Property="ButtonBase.IsPressed" Value="True">
  715. <Setter Property="UIElement.Effect">
  716. <Setter.Value>
  717. <DropShadowEffect
  718. BlurRadius="10"
  719. Direction="0"
  720. Opacity="0.9"
  721. RenderingBias="Performance"
  722. ShadowDepth="0"
  723. Color="#276AB0" />
  724. </Setter.Value>
  725. </Setter>
  726. <Setter Property="RenderTransform">
  727. <Setter.Value>
  728. <ScaleTransform ScaleX="0.9" ScaleY="0.9" />
  729. </Setter.Value>
  730. </Setter>
  731. <Setter Property="RenderTransformOrigin" Value=".5,.5" />
  732. </Trigger>
  733. </ControlTemplate.Triggers>
  734. </ControlTemplate>
  735. </Setter.Value>
  736. </Setter>
  737. </Style>
  738. <DataTemplate x:Key="Category">
  739. <TextBlock
  740. FontSize="20"
  741. Foreground="#4EB9E4"
  742. Text="{Binding}" />
  743. </DataTemplate>
  744. <!--#endregion-->
  745. </ResourceDictionary>