终端一体化运控平台
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.
 
 
 

449 righe
39 KiB

  1. <UserControl
  2. x:Class="BeDesignerSCADA.Controls.MainCanvasPanel"
  3. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  4. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  7. xmlns:local="clr-namespace:BeDesignerSCADA.Controls"
  8. xmlns:s="clr-namespace:BeDesignerSCADA.Converters"
  9. xmlns:icon="http://metro.mahapps.com/winfx/xaml/iconpacks"
  10. xmlns:avae="http://icsharpcode.net/sharpdevelop/avalonedit"
  11. xmlns:Compiler="clr-namespace:BPASmartClient.Compiler;assembly=BPASmartClient.Compiler"
  12. xmlns:ctl="clr-namespace:BeDesignerSCADA.Controls"
  13. xmlns:mypro="http://schemas.xceed.com/wpf/xaml/toolkit"
  14. mc:Ignorable="d"
  15. d:DesignHeight="900" d:DesignWidth="1400">
  16. <UserControl.Resources>
  17. <ResourceDictionary>
  18. <ResourceDictionary.MergedDictionaries>
  19. <ResourceDictionary Source="/可视化配置工具;component/Themes/Styles.xaml"/>
  20. <ResourceDictionary Source="/BPASmartClient.SCADAControl;component/Themes/Generic.xaml" />
  21. </ResourceDictionary.MergedDictionaries>
  22. </ResourceDictionary>
  23. </UserControl.Resources>
  24. <Grid x:Name="grid">
  25. <Grid.ColumnDefinitions>
  26. <ColumnDefinition Width="240"/>
  27. <ColumnDefinition/>
  28. <ColumnDefinition Width="320"/>
  29. </Grid.ColumnDefinitions>
  30. <!--左侧选择区域-->
  31. <Grid >
  32. <Border BorderThickness="1" BorderBrush="{StaticResource AccentBrush}" Background="Transparent" Margin="4">
  33. <ListBox x:Name="CtlList" Background="Transparent" ItemTemplate="{DynamicResource ToolBoxStyle}" BorderThickness="0" PreviewMouseMove="CtlList_PreviewMouseMove"/>
  34. </Border>
  35. </Grid>
  36. <!--中间控制区域-->
  37. <DockPanel Grid.Column="1">
  38. <!--按钮控制-->
  39. <DockPanel LastChildFill="False" DockPanel.Dock="Top" Height="24" Margin="4 4 4 0">
  40. <Button Margin="0" Width="24" Padding="0" Click="AglinLeftBtn_Click" ToolTip="左对齐">
  41. <icon:PackIconModern Kind="AlignLeft"/>
  42. </Button>
  43. <Button Margin="4 0 0 0" Width="24" Padding="0" Click="AglinRightBtn_Click" ToolTip="右对齐">
  44. <icon:PackIconModern Kind="AlignRight"/>
  45. </Button>
  46. <Button Margin="4 0 0 0" Width="24" Padding="0" Click="AglinCenterBtn_Click" ToolTip="中心对齐">
  47. <icon:PackIconModern Kind="AlignCenter"/>
  48. </Button>
  49. <Button Margin="4 0 0 0" Width="24" Padding="0" Click="AglinTopBtn_Click" ToolTip="上对齐">
  50. <icon:PackIconModern Kind="BorderTop"/>
  51. </Button>
  52. <Button Margin="4 0 0 0" Width="24" Padding="0" Click="AglinBottomBtn_Click" ToolTip="下对齐">
  53. <icon:PackIconModern Kind="BorderBottom"/>
  54. </Button>
  55. <Button Margin="16 0 0 0" Width="24" Padding="0" Click="HorizontalLayoutBtn_Click" ToolTip="水平分布">
  56. <icon:PackIconModern Kind="BorderHorizontal"/>
  57. </Button>
  58. <Button Margin="4 0 0 0" Width="24" Padding="0" Click="VerticalLayoutBtn_Click" ToolTip="垂直分布">
  59. <icon:PackIconModern Kind="BorderVertical"/>
  60. </Button>
  61. <ToggleButton IsChecked="{Binding UseAutoAlignment, ElementName=cav, Mode=TwoWay}" ToolTip="使用对齐网格" Margin="4 0 0 0" Width="24" Padding="0">
  62. <icon:PackIconModern Kind="CellAlign"/>
  63. </ToggleButton>
  64. <Button Margin="16 0 0 0" Width="24" Padding="0" ToolTip="复制" Command="{Binding ElementName=cav, Path=CopySelectItemsCommand}">
  65. <icon:PackIconModern Kind="PageCopy"/>
  66. </Button>
  67. <Button Margin="4 0 0 0" Width="24" Padding="0" ToolTip="粘贴" Command="{Binding ElementName=cav, Path=PasteSelectItemsCommand}">
  68. <icon:PackIconModern Kind="ClipboardPaste"/>
  69. </Button>
  70. <Button Margin="4 0 0 0" Width="24" Padding="0" ToolTip="删除" Command="{Binding ElementName=cav, Path=DeleteSelectItemsCommand}">
  71. <icon:PackIconModern Kind="Delete"/>
  72. </Button>
  73. <Button x:Name="RunBtn" Margin="16 0 0 0" Padding="0" Click="RunBtn_Click" Command="{Binding RunUiCommand}">
  74. <Button.Style>
  75. <Style TargetType="Button">
  76. <Setter Property="Tag" Value="运行"/>
  77. <Setter Property="Content">
  78. <Setter.Value>
  79. <StackPanel Orientation="Horizontal" Margin="8 0">
  80. <icon:PackIconModern Kind="ControlPlay" VerticalAlignment="Center" Foreground="#28B60F" Width="8"/>
  81. <TextBlock Text="运行" Margin="4 0" VerticalAlignment="Center"/>
  82. </StackPanel>
  83. </Setter.Value>
  84. </Setter>
  85. <Style.Triggers>
  86. <DataTrigger Binding="{Binding IsRunning}" Value="True">
  87. <Setter Property="Tag" Value="停止"/>
  88. <Setter Property="Content">
  89. <Setter.Value>
  90. <StackPanel Orientation="Horizontal" Margin="8 0">
  91. <icon:PackIconModern Kind="ControlStop" VerticalAlignment="Center" Foreground="#B60F0F" Width="8"/>
  92. <TextBlock Text="停止" Margin="4 0" VerticalAlignment="Center"/>
  93. </StackPanel>
  94. </Setter.Value>
  95. </Setter>
  96. </DataTrigger>
  97. </Style.Triggers>
  98. </Style>
  99. </Button.Style>
  100. </Button>
  101. <Button x:Name="Run1Btn" Margin="16 0 0 0" Padding="0" Click="MNRunBtn_Click">
  102. <StackPanel Orientation="Horizontal" Margin="8 0">
  103. <icon:PackIconModern Kind="ControlPlay" VerticalAlignment="Center" Foreground="#28B60F" Width="8"/>
  104. <TextBlock Text="模拟运行" Margin="4 0" VerticalAlignment="Center"/>
  105. </StackPanel>
  106. </Button>
  107. <Button x:Name="SaveBtn" Margin="16 0 0 0" Padding="0" Click="SaveBtn_Click">
  108. <StackPanel Orientation="Horizontal" Margin="8 0">
  109. <icon:PackIconModern Kind="Save" VerticalAlignment="Center" Width="12"/>
  110. <TextBlock Text="保存" Margin="4 0" VerticalAlignment="Center"/>
  111. </StackPanel>
  112. </Button>
  113. <Button x:Name="LoadBtn" Margin="4 0 0 0" Padding="0" Click="LoadBtn_Click">
  114. <StackPanel Orientation="Horizontal" Margin="8 0">
  115. <icon:PackIconModern Kind="DiskDownload" VerticalAlignment="Center" Width="14"/>
  116. <TextBlock Text="加载" Margin="4 0" VerticalAlignment="Center"/>
  117. </StackPanel>
  118. </Button>
  119. <Button x:Name="LoadBtnValue" Margin="4 0 0 0" Padding="0" Click="LoadBtnValue_Click">
  120. <StackPanel Orientation="Horizontal" Margin="8 0">
  121. <icon:PackIconModern Kind="DiskDownload" VerticalAlignment="Center" Width="14"/>
  122. <TextBlock Text="变量管理" Margin="4 0" VerticalAlignment="Center"/>
  123. </StackPanel>
  124. </Button>
  125. <ToggleButton x:Name="showCode" Click="showCode_Click" DockPanel.Dock="Right" Margin="4 0 0 0" Padding="4 0">
  126. <icon:Material Kind="FileCode"/>
  127. </ToggleButton>
  128. <!--<Slider DockPanel.Dock="Right" x:Name="slikl" Width="100" Maximum="16" Minimum="1" Margin="4 0 0 0"
  129. HorizontalContentAlignment="Center" Value="{Binding ElementName=cav,Path=GridPxiel}" />-->
  130. <!--<TextBlock DockPanel.Dock="Right" Text="对齐:" VerticalAlignment="Center" Margin="16 0 0 0"/>-->
  131. <CheckBox x:Name="IsYSSX" Content="原生属性" DockPanel.Dock="Right" VerticalAlignment="Center" Margin="0 0 0 0"></CheckBox>
  132. </DockPanel>
  133. <!--中间画布-->
  134. <Border BorderThickness="1" BorderBrush="{StaticResource AccentBrush}" Margin="4">
  135. <Border.Background>
  136. <ImageBrush ImageSource="../Images/bj.png" Stretch="UniformToFill"/>
  137. </Border.Background>
  138. <Grid>
  139. <Grid.ColumnDefinitions>
  140. <ColumnDefinition/>
  141. <ColumnDefinition Width="auto"/>
  142. </Grid.ColumnDefinitions>
  143. <ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible">
  144. <Grid>
  145. <Compiler:CanvasPanel x:Name="cav" Width="1920" Height="1080" Visibility="{Binding CanvasPanelVisibility}" SelectedItem="{Binding CanSelectedItem,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" AllowDrop="True" RenderTransformOrigin="0.5,0.5" ClipToBounds="True" UseLayoutRounding="True" Focusable="True" SnapsToDevicePixels="True">
  146. <Compiler:CanvasPanel.Background>
  147. <VisualBrush TileMode="Tile" Viewport="0,0,20,20" ViewportUnits="Absolute">
  148. <VisualBrush.Visual>
  149. <Rectangle Width="20" Height="20" StrokeDashArray="4,2" StrokeThickness="0.5" Stroke="#CBCBCB">
  150. <Rectangle.Style>
  151. <Style TargetType="{x:Type Rectangle}">
  152. <Style.Triggers>
  153. <DataTrigger Binding="{Binding UseAutoAlignment, RelativeSource={RelativeSource AncestorType={x:Type Compiler:CanvasPanel}, Mode=FindAncestor}}" Value="True">
  154. <Setter Property="Visibility" Value="Visible"/>
  155. </DataTrigger>
  156. <DataTrigger Binding="{Binding UseAutoAlignment, RelativeSource={RelativeSource AncestorType={x:Type Compiler:CanvasPanel}, Mode=FindAncestor}}" Value="False">
  157. <Setter Property="Visibility" Value="Collapsed"/>
  158. </DataTrigger>
  159. </Style.Triggers>
  160. </Style>
  161. </Rectangle.Style>
  162. </Rectangle>
  163. </VisualBrush.Visual>
  164. </VisualBrush>
  165. </Compiler:CanvasPanel.Background>
  166. <Compiler:CanvasPanel.RenderTransform>
  167. <TransformGroup>
  168. <TranslateTransform x:Name="CanvasTranslate"/>
  169. </TransformGroup>
  170. </Compiler:CanvasPanel.RenderTransform>
  171. </Compiler:CanvasPanel>
  172. <ctl:RunCanvas x:Name="runCanvas" Visibility="{Binding RunCanvasVisibility}" />
  173. </Grid>
  174. </ScrollViewer>
  175. <avae:TextEditor x:Name="codeEditor" ShowLineNumbers="True" Padding="4" WordWrap="True" IsReadOnly="True" SyntaxHighlighting="XML" BorderThickness="1 0 0 0" BorderBrush="{StaticResource ControlBorderBrush}" Grid.Column="1" Width="480" Visibility="{Binding ElementName=showCode, Path=IsChecked, Converter={x:Static s:BoolToVisibilityConverter.Instance}}"/>
  176. <TextBlock HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,20,20" FontSize="16" Foreground="Red">分辨率:1920×1080</TextBlock>
  177. </Grid>
  178. </Border>
  179. </DockPanel>
  180. <GridSplitter HorizontalAlignment="Right" Grid.Column="1" VerticalAlignment="Stretch" Width="5" Background="Transparent"/>
  181. <!--右侧属性栏-->
  182. <Grid Grid.Column="2">
  183. <TabControl SelectedIndex="0">
  184. <TabItem Header="属性设置">
  185. <mypro:PropertyGrid Margin="10" ShowAdvancedOptions="True" ShowDescriptionByTooltip="True"
  186. FontSize="14" ShowTitle="False" ShowSortOptions="False" ShowSearchBox="False"
  187. AutoGenerateProperties="False"
  188. CategoryGroupHeaderTemplate="{DynamicResource Category}" SelectedObject="{Binding SelectedItem,ElementName=cav,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" >
  189. <mypro:PropertyGrid.PropertyDefinitions>
  190. <mypro:PropertyDefinition Name="FontSize" ></mypro:PropertyDefinition>
  191. <mypro:PropertyDefinition DisplayName="名称" Category="基本属性" DisplayOrder="0" Name="Name" Description="设置控件的标识,可以在Js脚本中通过标识操作控件。"/>
  192. <mypro:PropertyDefinition DisplayName="内容" Category="基本属性" DisplayOrder="1" Name="Content"/>
  193. <mypro:PropertyDefinition DisplayName="标题" Category="基本属性" DisplayOrder="1" Name="Header" Description="Header"/>
  194. <mypro:PropertyDefinition DisplayName="文本" Category="基本属性" DisplayOrder="1" Name="Text" Description="Text"/>
  195. <mypro:PropertyDefinition DisplayName="值" Category="基本属性" DisplayOrder="2" Name="NumberValue" Description="NumberValue"/>
  196. <mypro:PropertyDefinition DisplayName="数值" Category="基本属性" DisplayOrder="2" Name="CurValue" Description="CurValue"/>
  197. <mypro:PropertyDefinition DisplayName="状态值" Category="基本属性" DisplayOrder="2" Name="StatusValue" Description="StatusValue"/>
  198. <mypro:PropertyDefinition DisplayName="勾选状态" Category="基本属性" DisplayOrder="2" Name="IsChecked" Description="IsChecked"/>
  199. <mypro:PropertyDefinition DisplayName="数值" Category="基本属性" DisplayOrder="2" Name="Value" Description="Value"/>
  200. <mypro:PropertyDefinition DisplayName="物料重量(g)" Category="基本属性" DisplayOrder="2" Name="KgValue" Description="克数"/>
  201. <mypro:PropertyDefinition DisplayName="物料描述" Category="基本属性" DisplayOrder="2" Name="WLText" Description="物料描述"/>
  202. <mypro:PropertyDefinition DisplayName="物料标题" Category="基本属性" DisplayOrder="2" Name="WLTitle" Description="物料标题"/>
  203. <mypro:PropertyDefinition DisplayName="标题" Category="基本属性" DisplayOrder="2" Name="Title" Description="标题"/>
  204. <mypro:PropertyDefinition DisplayName="运行状态" Category="基本属性" DisplayOrder="2" Name="Direction" Description="Direction"/>
  205. <mypro:PropertyDefinition DisplayName="Tag" Category="基本属性" DisplayOrder="2" Name="Tag" Description="Tag"/>
  206. <mypro:PropertyDefinition DisplayName="启动路径" Category="基本属性" DisplayOrder="2" Name="StartPath" Description="StartPath"/>
  207. <mypro:PropertyDefinition DisplayName="最大值" Category="基本属性" DisplayOrder="3" Name="MaxValue" Description="MaxValue"/>
  208. <mypro:PropertyDefinition DisplayName="最小值" Category="基本属性" DisplayOrder="3" Name="MinValue" Description="MinValue"/>
  209. <mypro:PropertyDefinition DisplayName="最大值" Category="基本属性" DisplayOrder="3" Name="Maximum" Description="Maximum"/>
  210. <mypro:PropertyDefinition DisplayName="最小值" Category="基本属性" DisplayOrder="3" Name="Minimum" Description="Minimum"/>
  211. <mypro:PropertyDefinition DisplayName="间隔" Category="基本属性" DisplayOrder="3" Name="Interval"/>
  212. <mypro:PropertyDefinition DisplayName="宽度" Category="基本属性" DisplayOrder="3" Name="Width"/>
  213. <mypro:PropertyDefinition DisplayName="高度" Category="基本属性" DisplayOrder="3" Name="Height"/>
  214. <mypro:PropertyDefinition DisplayName="勾选状态" Category="基本属性" DisplayOrder="3" Name="BindingIsChecked"/>
  215. <mypro:PropertyDefinition DisplayName="图片路径" Category="基本属性" DisplayOrder="3" Name="ImageStartPath" />
  216. <mypro:PropertyDefinition DisplayName="FontSize" Category="基本属性" DisplayOrder="4" Name="FontSize"/>
  217. <mypro:PropertyDefinition DisplayName="字体" Category="基本属性" DisplayOrder="4" Name="FontFamily"/>
  218. <mypro:PropertyDefinition DisplayName="字体样式" Category="基本属性" DisplayOrder="4" Name="FontWeight"/>
  219. <mypro:PropertyDefinition DisplayName="斜体" Category="基本属性" DisplayOrder="4" Name="FontStyle"/>
  220. <mypro:PropertyDefinition DisplayName="下划线" Category="基本属性" DisplayOrder="4" Name="TextDecorations"/>
  221. <mypro:PropertyDefinition DisplayName="文字环绕样式" Category="基本属性" DisplayOrder="4" Name="TextWrapping"/>
  222. <mypro:PropertyDefinition DisplayName="是否使能" Category="基本属性" DisplayOrder="5" Name="IsEnabled"/>
  223. <mypro:PropertyDefinition DisplayName="是否显示" Category="基本属性" DisplayOrder="5" Name="Visibility"/>
  224. <mypro:PropertyDefinition DisplayName="回车换行" Category="基本属性" DisplayOrder="5" Name="AcceptsReturn"/>
  225. <mypro:PropertyDefinition DisplayName="鼠标样式" Category="基本属性" DisplayOrder="5" Name="Cursor"/>
  226. <mypro:PropertyDefinition DisplayName="键盘触发顺序" Category="基本属性" DisplayOrder="5" Name="TabIndex"/>
  227. <mypro:PropertyDefinition DisplayName="控件透明度" Category="基本属性" DisplayOrder="5" Name="Opacity"/>
  228. <mypro:PropertyDefinition DisplayName="垂直滚动条" Category="基本属性" DisplayOrder="6" Name="VerticalScrollBarVisibility"/>
  229. <mypro:PropertyDefinition DisplayName="水平滚动条" Category="基本属性" DisplayOrder="6" Name="HorizontalScrollBarVisibility"/>
  230. <mypro:PropertyDefinition DisplayName="是否ESC触发" Category="基本属性" DisplayOrder="7" Name="IsCancel"/>
  231. <mypro:PropertyDefinition DisplayName="是否Enter触发" Category="基本属性" DisplayOrder="7" Name="IsDefault"/>
  232. <mypro:PropertyDefinition DisplayName="垂直对齐" Category="基本属性" DisplayOrder="8" Name="VerticalContentAlignment"/>
  233. <mypro:PropertyDefinition DisplayName="水平对齐" Category="基本属性" DisplayOrder="8" Name="HorizontalContentAlignment"/>
  234. <mypro:PropertyDefinition DisplayName="所属分组" Category="基本属性" DisplayOrder="9" Name="GroupName"/>
  235. <mypro:PropertyDefinition DisplayName="文本提示" Category="基本属性" DisplayOrder="9" Name="ToolTip"/>
  236. <mypro:PropertyDefinition DisplayName="左边距" Category="基本属性" DisplayOrder="9" Name="(Canvas.Left)"/>
  237. <mypro:PropertyDefinition DisplayName="上边距" Category="基本属性" DisplayOrder="9" Name="(Canvas.Top)"/>
  238. <mypro:PropertyDefinition DisplayName="启动测试" Category="基本属性" DisplayOrder="9" Name="TestData"/>
  239. <mypro:PropertyDefinition DisplayName="气缸左执行" Category="基本属性" DisplayOrder="10" Name="LeftTogIsChecked"/>
  240. <mypro:PropertyDefinition DisplayName="气缸右执行" Category="基本属性" DisplayOrder="10" Name="RightTogIsChecked"/>
  241. <mypro:PropertyDefinition DisplayName="背景透明" Category="基本属性" DisplayOrder="10" Name="IsCheckedColor"/>
  242. <mypro:PropertyDefinition DisplayName="边框宽度" Category="基本属性" DisplayOrder="10" Name="BKThickness"/>
  243. <mypro:PropertyDefinition DisplayName="虚线绘制" Category="基本属性" DisplayOrder="10" Name="BKStrokeDashArray"/>
  244. <mypro:PropertyDefinition DisplayName="边框粗细" Category="基本属性" DisplayOrder="11" Name="WaveThickness"/>
  245. <mypro:PropertyDefinition DisplayName="边框粗细" Category="基本属性" DisplayOrder="11" Name="StrokeThickness"/>
  246. <mypro:PropertyDefinition DisplayName="边框粗细" Category="基本属性" DisplayOrder="11" Name="BorderThickness"/>
  247. <mypro:PropertyDefinition DisplayName="布局方向" Category="基本属性" DisplayOrder="11" Name="Orientation"/>
  248. <mypro:PropertyDefinition DisplayName="数据来源类型" Category="数据绑定模块" DisplayOrder="0" Name="DataSouceType"/>
  249. <mypro:PropertyDefinition DisplayName="设备名称" Category="数据绑定模块" DisplayOrder="0" Name="DeviceName"/>
  250. <mypro:PropertyDefinition DisplayName="接口类型" Category="数据绑定模块" DisplayOrder="1" Name="InterfaceMode"/>
  251. <mypro:PropertyDefinition DisplayName="接口参数" Category="数据绑定模块" DisplayOrder="2" Name="InterfaceParameters"/>
  252. <mypro:PropertyDefinition DisplayName="连接信息" Category="数据绑定模块" DisplayOrder="3" Name="DataSouceInformation"/>
  253. <mypro:PropertyDefinition DisplayName="设备解析变量" Category="数据绑定模块" DisplayOrder="4" Name="DeviceValuleName"/>
  254. <mypro:PropertyDefinition DisplayName="模拟运行" Category="数据绑定模块" DisplayOrder="4" Name="IsRun"/>
  255. <mypro:PropertyDefinition DisplayName="数据源" Category="数据绑定模块" DisplayOrder="5" Name="FDataSouce"/>
  256. <mypro:PropertyDefinition DisplayName="代码过滤脚本" Category="数据绑定模块" DisplayOrder="6" Name="Code"/>
  257. <mypro:PropertyDefinition DisplayName="数据结果" Category="数据绑定模块" DisplayOrder="7" Name="GenerateData"/>
  258. <mypro:PropertyDefinition DisplayName="定时间隔" Category="数据绑定模块" DisplayOrder="8" Name="TimeCount"/>
  259. <mypro:PropertyDefinition DisplayName="列表项" Category="集合设置" Name="ItemsString" />
  260. <mypro:PropertyDefinition DisplayName="列表项" Category="集合设置" Name="TabItems" />
  261. <mypro:PropertyDefinition DisplayName="子控件模板" Category="集合设置" Name="ChildTemplateXml" />
  262. <mypro:PropertyDefinition DisplayName="前景色" Category="颜色设置" Name="Foreground"/>
  263. <mypro:PropertyDefinition DisplayName="背景色" Category="颜色设置" Name="Background"/>
  264. <mypro:PropertyDefinition DisplayName="填充颜色" Category="颜色设置" Name="BJColor"/>
  265. <mypro:PropertyDefinition DisplayName="选中色" Category="颜色设置" Name="DKColor"/>
  266. <mypro:PropertyDefinition DisplayName="边框色" Category="颜色设置" Name="BorderBrush"/>
  267. <mypro:PropertyDefinition DisplayName="填充" Category="颜色设置" DisplayOrder="5" Name="WaveFill"/>
  268. <mypro:PropertyDefinition DisplayName="边框" Category="颜色设置" DisplayOrder="5" Name="WaveStroke"/>
  269. <mypro:PropertyDefinition DisplayName="填充" Category="颜色设置" DisplayOrder="5" Name="Fill"/>
  270. <mypro:PropertyDefinition DisplayName="边框" Category="颜色设置" DisplayOrder="5" Name="Stroke"/>
  271. <mypro:PropertyDefinition DisplayName="点击事件" Category="事件绑定" DisplayOrder="0" Name="ClickExec" />
  272. <mypro:PropertyDefinition DisplayName="值改变事件" Category="事件绑定" DisplayOrder="1" Name="ValueChangedExecute" />
  273. <mypro:PropertyDefinition DisplayName="定时触发" Category="事件绑定" DisplayOrder="2" Name="TikcExecute" />
  274. <mypro:PropertyDefinition DisplayName="勾选事件" Category="事件绑定" DisplayOrder="3" Name="CheckedExec" />
  275. <mypro:PropertyDefinition DisplayName="取消勾选事件" Category="事件绑定" DisplayOrder="4" Name="UnCheckedExec" />
  276. <mypro:PropertyDefinition DisplayName="接收消息集" Category="事件绑定" DisplayOrder="5" Name="EventReceiveNameList" />
  277. <mypro:PropertyDefinition DisplayName="出料单击事件" Category="事件绑定" DisplayOrder="6" Name="ChuLiaoExecute" />
  278. <mypro:PropertyDefinition DisplayName="停止出料单击事件" Category="事件绑定" DisplayOrder="7" Name="StopChuLiaoExecute" />
  279. </mypro:PropertyGrid.PropertyDefinitions>
  280. <mypro:PropertyGrid.EditorDefinitions>
  281. <mypro:EditorTemplateDefinition TargetProperties="Opacity">
  282. <mypro:EditorTemplateDefinition.EditingTemplate>
  283. <DataTemplate>
  284. <Slider Maximum="1" Minimum="0" Value="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ></Slider>
  285. <!--<mypro: SelectedColor="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, Converter={x:Static s:ColorToStringConverter.Instance}}" />-->
  286. </DataTemplate>
  287. </mypro:EditorTemplateDefinition.EditingTemplate>
  288. </mypro:EditorTemplateDefinition>
  289. <mypro:EditorTemplateDefinition TargetProperties="Foreground,Background,BorderBrush,WaveFill,WaveStroke,Fill,Stroke,BJColor,DKColor">
  290. <mypro:EditorTemplateDefinition.EditingTemplate>
  291. <DataTemplate>
  292. <mypro:ColorPicker SelectedColor="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, Converter={x:Static s:ColorToStringConverter.Instance}}" />
  293. </DataTemplate>
  294. </mypro:EditorTemplateDefinition.EditingTemplate>
  295. </mypro:EditorTemplateDefinition>
  296. <mypro:EditorTemplateDefinition TargetProperties="ImageStartPath">
  297. <mypro:EditorTemplateDefinition.EditingTemplate>
  298. <DataTemplate>
  299. <Grid>
  300. <Grid.ColumnDefinitions>
  301. <ColumnDefinition Width="*"/>
  302. <ColumnDefinition Width="35"/>
  303. </Grid.ColumnDefinitions>
  304. <ToggleButton Grid.Column="1" Height="20" Content="..." Width="26" Margin="5,0,0,0" HorizontalAlignment="Left" Click="LJToggleButton_Click"></ToggleButton>
  305. <TextBox Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/>
  306. </Grid>
  307. </DataTemplate>
  308. </mypro:EditorTemplateDefinition.EditingTemplate>
  309. </mypro:EditorTemplateDefinition>
  310. <mypro:EditorTemplateDefinition TargetProperties="StartPath">
  311. <mypro:EditorTemplateDefinition.EditingTemplate>
  312. <DataTemplate>
  313. <Grid>
  314. <Grid.ColumnDefinitions>
  315. <ColumnDefinition Width="*"/>
  316. <ColumnDefinition Width="35"/>
  317. </Grid.ColumnDefinitions>
  318. <ToggleButton Grid.Column="1" Height="20" Content="选择" Width="26" Margin="5,0,0,0" HorizontalAlignment="Left" Click="XZToggleButton_Click"></ToggleButton>
  319. <TextBox Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/>
  320. </Grid>
  321. </DataTemplate>
  322. </mypro:EditorTemplateDefinition.EditingTemplate>
  323. </mypro:EditorTemplateDefinition>
  324. <!--子控件模板编辑-->
  325. <mypro:EditorTemplateDefinition TargetProperties="ChildTemplateXml">
  326. <mypro:EditorTemplateDefinition.EditingTemplate>
  327. <DataTemplate>
  328. <Grid>
  329. <ToggleButton Grid.Column="1" Height="30" Content=" 设置控件模板 " Margin="5,0,0,0" Click="ChildToggleButton_Click"></ToggleButton>
  330. <TextBox Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" Visibility="Collapsed"/>
  331. </Grid>
  332. </DataTemplate>
  333. </mypro:EditorTemplateDefinition.EditingTemplate>
  334. </mypro:EditorTemplateDefinition>
  335. <!--代码绑定模块-->
  336. <mypro:EditorTemplateDefinition TargetProperties="ClickExec,ValueChangedExecute,TikcExecute,CheckedExec,UnCheckedExec,ChuLiaoExecute,StopChuLiaoExecute" >
  337. <mypro:EditorTemplateDefinition.EditingTemplate>
  338. <DataTemplate>
  339. <Grid>
  340. <Grid.ColumnDefinitions>
  341. <ColumnDefinition Width="*"/>
  342. <ColumnDefinition Width="40"/>
  343. </Grid.ColumnDefinitions>
  344. <ToggleButton Grid.Column="1" Height="20" Content="编辑" Width="30" Margin="5,0,5,0" HorizontalAlignment="Left" Click="ToggleButton_Click"></ToggleButton>
  345. <TextBox Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/>
  346. </Grid>
  347. </DataTemplate>
  348. </mypro:EditorTemplateDefinition.EditingTemplate>
  349. </mypro:EditorTemplateDefinition>
  350. <mypro:EditorTemplateDefinition TargetProperties="Code" >
  351. <mypro:EditorTemplateDefinition.EditingTemplate>
  352. <DataTemplate>
  353. <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
  354. <TextBox Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" AcceptsReturn="True" TextWrapping="Wrap"></TextBox>
  355. </ScrollViewer>
  356. </DataTemplate>
  357. </mypro:EditorTemplateDefinition.EditingTemplate>
  358. </mypro:EditorTemplateDefinition>
  359. <mypro:EditorTemplateDefinition TargetProperties="IsRun,IsChecked" >
  360. <mypro:EditorTemplateDefinition.EditingTemplate>
  361. <DataTemplate>
  362. <StackPanel Grid.Column="1" Orientation="Horizontal">
  363. <CheckBox Margin="10,0,0,0" VerticalAlignment="Center" IsChecked="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></CheckBox>
  364. <ToggleButton Grid.Column="1" Height="20" Content="绑定" Width="30" Margin="20,0,0,0" HorizontalAlignment="Left" Click="BingToggleButton_Click"></ToggleButton>
  365. <ToggleButton Height="20" Content="解绑" Width="30" Margin="5,0,0,0" HorizontalAlignment="Right" Click="ClearBingToggleButton_Click"></ToggleButton>
  366. </StackPanel>
  367. </DataTemplate>
  368. </mypro:EditorTemplateDefinition.EditingTemplate>
  369. </mypro:EditorTemplateDefinition>
  370. <mypro:EditorTemplateDefinition TargetProperties="DeviceName" >
  371. <mypro:EditorTemplateDefinition.EditingTemplate>
  372. <DataTemplate>
  373. <ComboBox Grid.Column="1" Height="25" Width="{Binding Width, ElementName=com}" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
  374. ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl},Path=DataContext.DevNameList}"
  375. ></ComboBox>
  376. </DataTemplate>
  377. </mypro:EditorTemplateDefinition.EditingTemplate>
  378. </mypro:EditorTemplateDefinition>
  379. <mypro:EditorTemplateDefinition TargetProperties="Text,Title,Value,BindingIsChecked,Header,KgValue,WLText,WLTitle,DataSouceInformation,Direction,LeftTogIsChecked,RightTogIsChecked" >
  380. <mypro:EditorTemplateDefinition.EditingTemplate>
  381. <DataTemplate>
  382. <!--此处可自由发挥-->
  383. <Grid >
  384. <Grid.ColumnDefinitions>
  385. <ColumnDefinition Width="*"/>
  386. <ColumnDefinition Width="40"/>
  387. </Grid.ColumnDefinitions>
  388. <TextBox Grid.Row="2" x:Name="wenben" Padding="5" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap"></TextBox>
  389. <StackPanel Grid.Column="1">
  390. <ToggleButton Grid.Column="1" Height="20" Content="绑定" Width="30" Margin="5,0,5,0" HorizontalAlignment="Left" Click="BingToggleButton_Click"></ToggleButton>
  391. <ToggleButton Height="20" Content="解绑" Width="30" Margin="5,2,5,0" HorizontalAlignment="Right" Click="ClearBingToggleButton_Click"></ToggleButton>
  392. </StackPanel>
  393. </Grid>
  394. </DataTemplate>
  395. </mypro:EditorTemplateDefinition.EditingTemplate>
  396. </mypro:EditorTemplateDefinition>
  397. </mypro:PropertyGrid.EditorDefinitions>
  398. </mypro:PropertyGrid>
  399. </TabItem>
  400. <TabItem Header="原生属性" Visibility="{Binding ElementName=IsYSSX, Path=IsChecked, Converter={x:Static s:BoolToVisibilityConverter.Instance}}">
  401. <mypro:PropertyGrid Margin="10" ShowAdvancedOptions="True" ShowDescriptionByTooltip="True"
  402. FontSize="14" ShowTitle="False" ShowSortOptions="False" ShowSearchBox="False"
  403. CategoryGroupHeaderTemplate="{DynamicResource Category}" SelectedObject="{Binding SelectedItem,ElementName=cav,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
  404. </TabItem>
  405. </TabControl>
  406. </Grid>
  407. </Grid>
  408. </UserControl>