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

557 lines
48 KiB

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