终端一体化运控平台
No puede seleccionar más de 25 temas Los temas deben comenzar con una letra o número, pueden incluir guiones ('-') y pueden tener hasta 35 caracteres de largo.
 
 
 

609 líneas
30 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:dxmvmm="clr-namespace:BeDesignerSCADA.Converters"
  6. xmlns:icon="http://metro.mahapps.com/winfx/xaml/iconpacks"
  7. xmlns:input="clr-namespace:System.Windows.Input;assembly=PresentationCore">
  8. <!--#region 主题笔刷-->
  9. <LinearGradientBrush x:Key="NormalBackground" StartPoint="0.5,0" EndPoint="0.5,1">
  10. <GradientStopCollection>
  11. <GradientStop Color="White" />
  12. <GradientStop Offset="0.5" Color="#D0D0D0" />
  13. <GradientStop Offset="1" Color="#E3E3E3" />
  14. </GradientStopCollection>
  15. </LinearGradientBrush>
  16. <SolidColorBrush x:Key="AccentBrush" Color="#2B79E2" />
  17. <SolidColorBrush x:Key="ControlBorderBrush" Color="LightGray" />
  18. <SolidColorBrush x:Key="ControlBackground" Color="White" />
  19. <SolidColorBrush x:Key="ControlForeground" Color="Black" />
  20. <!--#endregion-->
  21. <!--#region 转换器-->
  22. <con:HalfNumberConverter x:Key="HalfNumber" />
  23. <!--#endregion-->
  24. <!--#region 编辑模板-->
  25. <DataTemplate x:Key="EventEditTemplate">
  26. <DockPanel Height="24">
  27. <Button
  28. Margin="2"
  29. Command="{Binding DataContext.EditCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
  30. CommandParameter="{Binding .}"
  31. Content="..."
  32. DockPanel.Dock="Right" />
  33. <TextBlock
  34. Margin="4,0,0,0"
  35. VerticalAlignment="Center"
  36. Text="{Binding Value}" />
  37. </DockPanel>
  38. </DataTemplate>
  39. <DataTemplate x:Key="ListEditTemplate">
  40. <DockPanel MaxHeight="100">
  41. <DockPanel DockPanel.Dock="Top">
  42. <Button
  43. Margin="2"
  44. Padding="2"
  45. Command="{Binding Value.AddCommand}"
  46. CommandParameter="{Binding ElementName=AddTxt, Path=Text}"
  47. DockPanel.Dock="Right">
  48. <icon:PackIconModern Kind="EditAdd" />
  49. </Button>
  50. <Button
  51. Margin="2"
  52. Padding="2"
  53. Command="{Binding Value.DeleteCommand}"
  54. CommandParameter="{Binding ElementName=list, Path=SelectedItem}"
  55. DockPanel.Dock="Right">
  56. <icon:PackIconModern Kind="Delete" />
  57. </Button>
  58. <TextBox x:Name="AddTxt" Margin="2" />
  59. </DockPanel>
  60. <ListBox
  61. x:Name="list"
  62. Margin="2"
  63. ItemsSource="{Binding Value}" />
  64. </DockPanel>
  65. </DataTemplate>
  66. <DataTemplate x:Key="ImagePathEditTemplate">
  67. <DockPanel>
  68. <Button
  69. Width="20"
  70. Height="20"
  71. Margin="2"
  72. Padding="0"
  73. Command="{Binding DataContext.SelectPathCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=Window}}"
  74. CommandParameter="{Binding .}"
  75. Content="..."
  76. DockPanel.Dock="Right" />
  77. <TextBox
  78. x:Name="AddTxt"
  79. BorderThickness="0"
  80. DockPanel.Dock="Right"
  81. Text="{Binding Value}" />
  82. </DockPanel>
  83. </DataTemplate>
  84. <!--#endregion-->
  85. <!--#region 为某些获取焦点的控件设计设计时样式-->
  86. <Style x:Key="DesignComboBox" TargetType="ComboBox">
  87. <Setter Property="Focusable" Value="False" />
  88. <Setter Property="Template">
  89. <Setter.Value>
  90. <ControlTemplate TargetType="ComboBox">
  91. <Border BorderBrush="{StaticResource ControlBorderBrush}" BorderThickness="1">
  92. <Grid>
  93. <Grid.ColumnDefinitions>
  94. <ColumnDefinition />
  95. <ColumnDefinition Width="auto" />
  96. </Grid.ColumnDefinitions>
  97. <Border Background="{StaticResource ControlBackground}" />
  98. <Border
  99. Grid.Column="1"
  100. Background="{StaticResource ControlBackground}"
  101. BorderThickness="0"
  102. IsEnabled="False">
  103. <Path
  104. Margin="3"
  105. VerticalAlignment="Center"
  106. Data="M0,0 8,0 4,4z"
  107. Fill="{StaticResource ControlForeground}" />
  108. </Border>
  109. </Grid>
  110. </Border>
  111. </ControlTemplate>
  112. </Setter.Value>
  113. </Setter>
  114. </Style>
  115. <!--<Style TargetType="Button" x:Key="DesignButton">
  116. <Setter Property="Template">
  117. <Setter.Value>
  118. <ControlTemplate TargetType="Button">
  119. <Border BorderThickness="1" BorderBrush="{StaticResource ControlBorderBrush}" Background="{StaticResource ControlBackground}">
  120. <TextBlock Text="{TemplateBinding Content}" FontSize="{TemplateBinding FontSize}"
  121. FontWeight="{TemplateBinding FontWeight}" HorizontalAlignment="Center" VerticalAlignment="Center"/>
  122. </Border>
  123. </ControlTemplate>
  124. </Setter.Value>
  125. </Setter>
  126. </Style>-->
  127. <Style x:Key="DesignToggleButton" TargetType="ToggleButton">
  128. <Setter Property="Foreground" Value="{StaticResource ControlForeground}" />
  129. <Setter Property="Template">
  130. <Setter.Value>
  131. <ControlTemplate TargetType="ToggleButton">
  132. <Border
  133. Background="{StaticResource NormalBackground}"
  134. BorderBrush="{StaticResource ControlBorderBrush}"
  135. BorderThickness="1"
  136. CornerRadius="2">
  137. <TextBlock
  138. HorizontalAlignment="Center"
  139. VerticalAlignment="Center"
  140. FontSize="{TemplateBinding FontSize}"
  141. FontWeight="{TemplateBinding FontWeight}"
  142. Text="{TemplateBinding Content}" />
  143. </Border>
  144. </ControlTemplate>
  145. </Setter.Value>
  146. </Setter>
  147. </Style>
  148. <Style x:Key="ExecuteToggleButton" TargetType="ToggleButton">
  149. <Setter Property="Foreground" Value="{StaticResource ControlForeground}" />
  150. <Setter Property="Foreground" Value="{StaticResource ControlForeground}" />
  151. <Setter Property="Template">
  152. <Setter.Value>
  153. <ControlTemplate TargetType="ToggleButton">
  154. <Border
  155. x:Name="bd"
  156. Background="{StaticResource NormalBackground}"
  157. BorderBrush="{StaticResource ControlBorderBrush}"
  158. BorderThickness="1"
  159. CornerRadius="2">
  160. <TextBlock
  161. HorizontalAlignment="Center"
  162. VerticalAlignment="Center"
  163. FontSize="{TemplateBinding FontSize}"
  164. FontWeight="{TemplateBinding FontWeight}"
  165. Text="{TemplateBinding Content}" />
  166. </Border>
  167. <ControlTemplate.Triggers>
  168. <Trigger Property="IsChecked" Value="True">
  169. <Setter TargetName="bd" Property="Background">
  170. <Setter.Value>
  171. <LinearGradientBrush StartPoint="0.5,0" EndPoint="0.5,1">
  172. <GradientStopCollection>
  173. <GradientStop Color="#6AD456" />
  174. <GradientStop Offset="0.5" Color="#1DAE06" />
  175. <GradientStop Offset="1" Color="#8BDC7C" />
  176. </GradientStopCollection>
  177. </LinearGradientBrush>
  178. </Setter.Value>
  179. </Setter>
  180. </Trigger>
  181. </ControlTemplate.Triggers>
  182. </ControlTemplate>
  183. </Setter.Value>
  184. </Setter>
  185. </Style>
  186. <!--#endregion-->
  187. <!--#region 其他-->
  188. <DataTemplate x:Key="PageBoxStyle">
  189. <Button x:Name="dsd" Background="#4818659B" BorderBrush="Transparent" CommandParameter="{Binding .}" Command="{Binding DataContext.SelectPageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}">
  190. <Button.Template>
  191. <ControlTemplate>
  192. <Grid x:Name="mains" Margin="0">
  193. <Grid.RowDefinitions>
  194. <RowDefinition Height="auto"/>
  195. <RowDefinition Height="auto"/>
  196. </Grid.RowDefinitions>
  197. <Grid>
  198. <Grid.Background>
  199. <ImageBrush ImageSource="../Images/bj.png" Stretch="UniformToFill"/>
  200. </Grid.Background>
  201. </Grid>
  202. <Grid Grid.Row="1" Background="#010AA74D">
  203. </Grid>
  204. <Rectangle Height="100" Width="200" StrokeThickness="0">
  205. <Rectangle.Fill>
  206. <VisualBrush Visual="{Binding visual,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
  207. </Rectangle.Fill>
  208. </Rectangle>
  209. <StackPanel Grid.Row="1" Orientation="Horizontal">
  210. <icon:PackIconModern x:Name="Sort" Width="10" HorizontalAlignment="Center" VerticalAlignment="Center" Margin="5,0,5,0" Foreground="White" Kind="Page" />
  211. <TextBlock Margin="5,0,0,0" Foreground="White" FontSize="12" HorizontalAlignment="Left"
  212. VerticalAlignment="Bottom"
  213. Text="{Binding Sort,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></TextBlock>
  214. <TextBlock Foreground="White" FontSize="12" HorizontalAlignment="Left"
  215. VerticalAlignment="Bottom"
  216. Text="-"></TextBlock>
  217. <TextBlock Margin="0,0,0,0" FontSize="12" Foreground="White"
  218. x:Name="txt" Grid.Column="1" HorizontalAlignment="Left"
  219. VerticalAlignment="Bottom"
  220. Text="{Binding Name,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
  221. </StackPanel>
  222. <StackPanel x:Name="stack" Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,10,0">
  223. <Button Width="24" Cursor="Hand" BorderBrush="Transparent" Background="Transparent" CommandParameter="{Binding .}" Command="{Binding DataContext.AddPageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" Padding="0" Margin="0,0,0,0" ToolTip="增加页">
  224. <icon:PackIconModern ToolTip="增加页" Width="10" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="White" Kind="Add" />
  225. </Button>
  226. <Button Width="24" Cursor="Hand" BorderBrush="Transparent" Background="Transparent" CommandParameter="{Binding .}" Command="{Binding DataContext.DeletePageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" VerticalAlignment="Center" Padding="0" ToolTip="删除页">
  227. <icon:PackIconModern ToolTip="删除页" Width="10" HorizontalAlignment="Center" Foreground="White" Kind="Delete" />
  228. </Button>
  229. <Button Width="24" Cursor="Hand" BorderBrush="Transparent" Background="Transparent" CommandParameter="{Binding .}" Command="{Binding DataContext.ClearPageCommand, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" VerticalAlignment="Center" Padding="0" ToolTip="清空页">
  230. <icon:PackIconModern ToolTip="清空页" Width="10" HorizontalAlignment="Center" Foreground="White" Kind="Clean" />
  231. </Button>
  232. </StackPanel>
  233. </Grid>
  234. <ControlTemplate.Triggers>
  235. <Trigger Property="IsMouseOver" Value="True">
  236. <Setter Property="Visibility" Value="Visible" TargetName="stack"></Setter>
  237. </Trigger>
  238. <Trigger Property="IsMouseOver" Value="false">
  239. <Setter Property="Visibility" Value="Collapsed" TargetName="stack"></Setter>
  240. </Trigger>
  241. <DataTrigger Binding="{Binding IsHome,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Value="True">
  242. <Setter TargetName="Sort" Property="Kind" Value="Home" />
  243. </DataTrigger>
  244. <DataTrigger Binding="{Binding IsHome,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" Value="False">
  245. <Setter TargetName="Sort" Property="Kind" Value="Page" />
  246. </DataTrigger>
  247. </ControlTemplate.Triggers>
  248. </ControlTemplate>
  249. </Button.Template>
  250. </Button>
  251. </DataTemplate>
  252. <DataTemplate x:Key="ToolBoxStyle">
  253. <Grid Margin="2" Background="Transparent">
  254. <Grid.ColumnDefinitions>
  255. <ColumnDefinition Width="30" />
  256. <ColumnDefinition />
  257. </Grid.ColumnDefinitions>
  258. <icon:PackIconMaterial
  259. x:Name="icon"
  260. Width="24"
  261. HorizontalAlignment="Stretch"
  262. VerticalAlignment="Stretch"
  263. BorderThickness="1"
  264. Kind="Ellipse" />
  265. <TextBlock
  266. x:Name="txt"
  267. Grid.Column="1"
  268. Margin="4"
  269. Text="{Binding Name}" />
  270. </Grid>
  271. <DataTemplate.Triggers>
  272. <DataTrigger Binding="{Binding Name}" Value="TheButton">
  273. <Setter TargetName="icon" Property="Kind" Value="GestureTapButton" />
  274. <Setter TargetName="txt" Property="Text" Value="按钮" />
  275. </DataTrigger>
  276. <DataTrigger Binding="{Binding Name}" Value="TheTimer">
  277. <Setter TargetName="icon" Property="Kind" Value="Timer" />
  278. <Setter TargetName="txt" Property="Text" Value="计时器" />
  279. </DataTrigger>
  280. <DataTrigger Binding="{Binding Name}" Value="TheCheckBox">
  281. <Setter TargetName="icon" Property="Kind" Value="CheckboxMarked" />
  282. <Setter TargetName="txt" Property="Text" Value="勾选框" />
  283. </DataTrigger>
  284. <DataTrigger Binding="{Binding Name}" Value="DigitalNumber">
  285. <Setter TargetName="icon" Property="Kind" Value="LedStrip" />
  286. <Setter TargetName="txt" Property="Text" Value="液晶数字" />
  287. </DataTrigger>
  288. <DataTrigger Binding="{Binding Name}" Value="TheComboBox">
  289. <Setter TargetName="icon" Property="Kind" Value="ViewList" />
  290. <Setter TargetName="txt" Property="Text" Value="下拉框" />
  291. </DataTrigger>
  292. <DataTrigger Binding="{Binding Name}" Value="TheImage">
  293. <Setter TargetName="icon" Property="Kind" Value="Image" />
  294. <Setter TargetName="txt" Property="Text" Value="图片" />
  295. </DataTrigger>
  296. <DataTrigger Binding="{Binding Name}" Value="TheTextBlock">
  297. <Setter TargetName="icon" Property="Kind" Value="TagText" />
  298. <Setter TargetName="txt" Property="Text" Value="文本块" />
  299. </DataTrigger>
  300. <DataTrigger Binding="{Binding Name}" Value="ArcGauge">
  301. <Setter TargetName="icon" Property="Kind" Value="Gauge" />
  302. <Setter TargetName="txt" Property="Text" Value="仪表盘" />
  303. </DataTrigger>
  304. <DataTrigger Binding="{Binding Name}" Value="StatusLight">
  305. <Setter TargetName="icon" Property="Kind" Value="CeilingLight" />
  306. <Setter TargetName="txt" Property="Text" Value="状态灯" />
  307. </DataTrigger>
  308. <DataTrigger Binding="{Binding Name}" Value="TheToggleButton">
  309. <Setter TargetName="icon" Property="Kind" Value="CheckOutline" />
  310. <Setter TargetName="txt" Property="Text" Value="开关按钮" />
  311. </DataTrigger>
  312. <DataTrigger Binding="{Binding Name}" Value="TheGroupBox">
  313. <Setter TargetName="icon" Property="Kind" Value="Group" />
  314. <Setter TargetName="txt" Property="Text" Value="分组" />
  315. </DataTrigger>
  316. <DataTrigger Binding="{Binding Name}" Value="TheTextBox">
  317. <Setter TargetName="icon" Property="Kind" Value="TextBox" />
  318. <Setter TargetName="txt" Property="Text" Value="文本框" />
  319. </DataTrigger>
  320. <DataTrigger Binding="{Binding Name}" Value="NumberBox">
  321. <Setter TargetName="icon" Property="Kind" Value="Numeric8Box" />
  322. <Setter TargetName="txt" Property="Text" Value="数值框" />
  323. </DataTrigger>
  324. <DataTrigger Binding="{Binding Name}" Value="GraphArrow">
  325. <Setter TargetName="icon" Property="Kind" Value="ArrowRightBold" />
  326. <Setter TargetName="txt" Property="Text" Value="箭头" />
  327. </DataTrigger>
  328. <DataTrigger Binding="{Binding Name}" Value="GraphStar">
  329. <Setter TargetName="icon" Property="Kind" Value="Star" />
  330. <Setter TargetName="txt" Property="Text" Value="五角星" />
  331. </DataTrigger>
  332. <DataTrigger Binding="{Binding Name}" Value="TheSlider">
  333. <Setter TargetName="icon" Property="Kind" Value="ArrowDownBold" />
  334. <Setter TargetName="txt" Property="Text" Value="滑块" />
  335. </DataTrigger>
  336. <DataTrigger Binding="{Binding Name}" Value="TheRadioButton">
  337. <Setter TargetName="icon" Property="Kind" Value="RadioboxMarked" />
  338. <Setter TargetName="txt" Property="Text" Value="单选按钮" />
  339. </DataTrigger>
  340. <DataTrigger Binding="{Binding Name}" Value="SwitchButton">
  341. <Setter TargetName="icon" Property="Kind" Value="ToggleSwitch" />
  342. <Setter TargetName="txt" Property="Text" Value="开关" />
  343. </DataTrigger>
  344. <DataTrigger Binding="{Binding Name}" Value="KnobButton">
  345. <Setter TargetName="icon" Property="Kind" Value="Ellipse" />
  346. <Setter TargetName="txt" Property="Text" Value="旋钮" />
  347. </DataTrigger>
  348. <DataTrigger Binding="{Binding Name}" Value="Silos">
  349. <Setter TargetName="icon" Property="Kind" Value="StoreSettings" />
  350. <Setter TargetName="txt" Property="Text" Value="物料仓" />
  351. </DataTrigger>
  352. <DataTrigger Binding="{Binding Name}" Value="NewConveyorBelt">
  353. <Setter TargetName="icon" Property="Kind" Value="Attachment" />
  354. <Setter TargetName="txt" Property="Text" Value="滚动线" />
  355. </DataTrigger>
  356. <DataTrigger Binding="{Binding Name}" Value="TheDataGrid">
  357. <Setter TargetName="icon" Property="Kind" Value="BorderAll" />
  358. <Setter TargetName="txt" Property="Text" Value="表格" />
  359. </DataTrigger>
  360. <DataTrigger Binding="{Binding Name}" Value="TheListBox">
  361. <Setter TargetName="icon" Property="Kind" Value="ViewHeadline" />
  362. <Setter TargetName="txt" Property="Text" Value="列表控件" />
  363. </DataTrigger>
  364. <DataTrigger Binding="{Binding Name}" Value="FYFTheListBox">
  365. <Setter TargetName="icon" Property="Kind" Value="ViewHeadline" />
  366. <Setter TargetName="txt" Property="Text" Value="列表控件-拖拽" />
  367. </DataTrigger>
  368. <DataTrigger Binding="{Binding Name}" Value="TheRedis">
  369. <Setter TargetName="icon" Property="Kind" Value="AlphaDBoxOutline" />
  370. <Setter TargetName="txt" Property="Text" Value="Redis控件" />
  371. </DataTrigger>
  372. <DataTrigger Binding="{Binding Name}" Value="WaveProgressBar">
  373. <Setter TargetName="icon" Property="Kind" Value="Wave" />
  374. <Setter TargetName="txt" Property="Text" Value="进度条波浪" />
  375. </DataTrigger>
  376. <DataTrigger Binding="{Binding Name}" Value="TheProgressBar">
  377. <Setter TargetName="icon" Property="Kind" Value="Texture" />
  378. <Setter TargetName="txt" Property="Text" Value="进度条正常" />
  379. </DataTrigger>
  380. <DataTrigger Binding="{Binding Name}" Value="TheRedProgressBar">
  381. <Setter TargetName="icon" Property="Kind" Value="CircleSlice5" />
  382. <Setter TargetName="txt" Property="Text" Value="进度条圆形红" />
  383. </DataTrigger>
  384. <DataTrigger Binding="{Binding Name}" Value="TheBlueProgressBar">
  385. <Setter TargetName="icon" Property="Kind" Value="CircleSlice5" />
  386. <Setter TargetName="txt" Property="Text" Value="进度条圆形蓝" />
  387. </DataTrigger>
  388. <DataTrigger Binding="{Binding Name}" Value="TheGreenProgressBar">
  389. <Setter TargetName="icon" Property="Kind" Value="CircleSlice5" />
  390. <Setter TargetName="txt" Property="Text" Value="进度条圆形绿" />
  391. </DataTrigger>
  392. <DataTrigger Binding="{Binding Name}" Value="TheAPI">
  393. <Setter TargetName="icon" Property="Kind" Value="AlphaABoxOutline" />
  394. <Setter TargetName="txt" Property="Text" Value="API接口" />
  395. </DataTrigger>
  396. <DataTrigger Binding="{Binding Name}" Value="TheMQTT">
  397. <Setter TargetName="icon" Property="Kind" Value="AlphaMBoxOutline" />
  398. <Setter TargetName="txt" Property="Text" Value="MQTT" />
  399. </DataTrigger>
  400. <DataTrigger Binding="{Binding Name}" Value="TheTabControl">
  401. <Setter TargetName="icon" Property="Kind" Value="PeriodicTable" />
  402. <Setter TargetName="txt" Property="Text" Value="选项卡控件" />
  403. </DataTrigger>
  404. <DataTrigger Binding="{Binding Name}" Value="TheCylinder">
  405. <Setter TargetName="icon" Property="Kind" Value="AlphaGCircleOutline" />
  406. <Setter TargetName="txt" Property="Text" Value="气缸控件" />
  407. </DataTrigger>
  408. <DataTrigger Binding="{Binding Name}" Value="TheRectangle">
  409. <Setter TargetName="icon" Property="Kind" Value="AlphaGCircleOutline" />
  410. <Setter TargetName="txt" Property="Text" Value="矩形" />
  411. </DataTrigger>
  412. <DataTrigger Binding="{Binding Name}" Value="TheEllipse">
  413. <Setter TargetName="icon" Property="Kind" Value="AlphaGCircleOutline" />
  414. <Setter TargetName="txt" Property="Text" Value="圆形" />
  415. </DataTrigger>
  416. <DataTrigger Binding="{Binding Name}" Value="TheWuLiaoControl">
  417. <Setter TargetName="icon" Property="Kind" Value="AlphaGCircleOutline" />
  418. <Setter TargetName="txt" Property="Text" Value="物料集合控件" />
  419. </DataTrigger>
  420. <DataTrigger Binding="{Binding Name}" Value="ThePopMessage">
  421. <Setter TargetName="icon" Property="Kind" Value="Message" />
  422. <Setter TargetName="txt" Property="Text" Value="消息弹窗" />
  423. </DataTrigger>
  424. <DataTrigger Binding="{Binding Name}" Value="TheMessage">
  425. <Setter TargetName="icon" Property="Kind" Value="Message" />
  426. <Setter TargetName="txt" Property="Text" Value="消息提示" />
  427. </DataTrigger>
  428. </DataTemplate.Triggers>
  429. </DataTemplate>
  430. <FontFamily x:Key="Digital">
  431. pack://application:,,,/Fonts/#DS-Digital
  432. </FontFamily>
  433. <!--#endregion-->
  434. <!--#region 右键菜单-->
  435. <ContextMenu
  436. x:Key="CanvasRightMenu"
  437. DataContext="{Binding PlacementTarget, RelativeSource={RelativeSource Self}}"
  438. FontFamily="Microsoft YaHei Ui">
  439. <MenuItem Command="{Binding CopySelectItemsCommand}" Header="复制">
  440. <MenuItem.Icon>
  441. <icon:PackIconModern
  442. Width="10"
  443. HorizontalAlignment="Center"
  444. Kind="PageCopy" />
  445. </MenuItem.Icon>
  446. </MenuItem>
  447. <MenuItem Command="{Binding PasteSelectItemsCommand}" Header="粘贴">
  448. <MenuItem.Icon>
  449. <icon:PackIconModern
  450. Width="10"
  451. HorizontalAlignment="Center"
  452. Kind="ClipboardPaste" />
  453. </MenuItem.Icon>
  454. </MenuItem>
  455. <MenuItem Command="{Binding DeleteSelectItemsCommand}" Header="删除">
  456. <MenuItem.Icon>
  457. <icon:PackIconModern
  458. Width="10"
  459. HorizontalAlignment="Center"
  460. Kind="Delete" />
  461. </MenuItem.Icon>
  462. </MenuItem>
  463. </ContextMenu>
  464. <ContextMenu
  465. x:Key="AdornerRightMenu"
  466. DataContext="{Binding PlacementTarget.Tag, RelativeSource={RelativeSource Mode=Self}}"
  467. FontFamily="Microsoft YaHei Ui">
  468. <MenuItem Command="{Binding CopySelectItemsCommand}" Header="复制">
  469. <MenuItem.Icon>
  470. <icon:PackIconModern
  471. Width="10"
  472. HorizontalAlignment="Center"
  473. Kind="PageCopy" />
  474. </MenuItem.Icon>
  475. </MenuItem>
  476. <MenuItem Command="{Binding PasteSelectItemsCommand}" Header="粘贴">
  477. <MenuItem.Icon>
  478. <icon:PackIconModern
  479. Width="10"
  480. HorizontalAlignment="Center"
  481. Kind="ClipboardPaste" />
  482. </MenuItem.Icon>
  483. </MenuItem>
  484. <MenuItem Command="{Binding DeleteSelectItemsCommand}" Header="删除">
  485. <MenuItem.Icon>
  486. <icon:PackIconModern
  487. Width="10"
  488. HorizontalAlignment="Center"
  489. Kind="Delete" />
  490. </MenuItem.Icon>
  491. </MenuItem>
  492. <MenuItem Command="{Binding SetTopLayerCommand}" Header="置于顶层">
  493. <MenuItem.Icon>
  494. <icon:PackIconMaterial
  495. Width="10"
  496. HorizontalAlignment="Center"
  497. Kind="ArrangeSendToBack" />
  498. </MenuItem.Icon>
  499. </MenuItem>
  500. <MenuItem Command="{Binding SetBottomLayerCommand}" Header="置于底层">
  501. <MenuItem.Icon>
  502. <icon:PackIconMaterial
  503. Width="10"
  504. HorizontalAlignment="Center"
  505. Kind="ArrangeBringToFront" />
  506. </MenuItem.Icon>
  507. </MenuItem>
  508. </ContextMenu>
  509. <!--#endregion-->
  510. <!--#region 控制集合-->
  511. <Style TargetType="{x:Type ToggleButton}">
  512. <Setter Property="Foreground" Value="White" />
  513. <Setter Property="FontFamily" Value="Microsoft YaHei" />
  514. <Setter Property="FontSize" Value="12" />
  515. <Setter Property="FontWeight" Value="Bold" />
  516. <Setter Property="Template">
  517. <Setter.Value>
  518. <ControlTemplate TargetType="ToggleButton">
  519. <Border
  520. BorderBrush="{TemplateBinding Control.BorderBrush}"
  521. BorderThickness="0"
  522. CornerRadius="2">
  523. <Border.Background>
  524. <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
  525. <GradientStop Offset="0.0" Color="#FF71E0C6" />
  526. <GradientStop Offset="0.2" Color="#FF43A88D" />
  527. <GradientStop Offset="0.0" Color="#FF5BB07D" />
  528. </LinearGradientBrush>
  529. </Border.Background>
  530. <ContentPresenter
  531. HorizontalAlignment="Center"
  532. VerticalAlignment="Center"
  533. Content="{TemplateBinding ContentControl.Content}" />
  534. </Border>
  535. <ControlTemplate.Triggers>
  536. <Trigger Property="ButtonBase.IsPressed" Value="True">
  537. <Setter Property="UIElement.Effect">
  538. <Setter.Value>
  539. <DropShadowEffect
  540. BlurRadius="10"
  541. Direction="0"
  542. Opacity="0.9"
  543. RenderingBias="Performance"
  544. ShadowDepth="0"
  545. Color="#276AB0" />
  546. </Setter.Value>
  547. </Setter>
  548. <Setter Property="RenderTransform">
  549. <Setter.Value>
  550. <ScaleTransform ScaleX="0.9" ScaleY="0.9" />
  551. </Setter.Value>
  552. </Setter>
  553. <Setter Property="RenderTransformOrigin" Value=".5,.5" />
  554. </Trigger>
  555. </ControlTemplate.Triggers>
  556. </ControlTemplate>
  557. </Setter.Value>
  558. </Setter>
  559. </Style>
  560. <DataTemplate x:Key="Category">
  561. <TextBlock
  562. FontSize="20"
  563. Foreground="#4EB9E4"
  564. Text="{Binding}" />
  565. </DataTemplate>
  566. <!--#endregion-->
  567. </ResourceDictionary>