终端一体化运控平台
25개 이상의 토픽을 선택하실 수 없습니다. Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

CanvasPanelNew.xaml 46 KiB

2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
2 년 전
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  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="50" Minimum="4" 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>
  244. <ctl:RunCanvas x:Name="runCanvas" Visibility="{Binding DataContext.RunCanvasVisibility, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" />
  245. </Grid>
  246. </ScrollViewer>
  247. <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}}"/>
  248. <TextBlock HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,20,20" FontSize="16" Foreground="Red">分辨率:1920×1080</TextBlock>
  249. </Grid>
  250. </Border>
  251. </DockPanel>
  252. <GridSplitter HorizontalAlignment="Right" Grid.Column="1" VerticalAlignment="Stretch" Width="5" Background="Transparent"/>
  253. <!--右侧属性栏-->
  254. <Grid Grid.Column="2">
  255. <TabControl x:Name="ReditSeleceTab" SelectedIndex="0">
  256. <TabItem Header="页面设置">
  257. <mypro:PropertyGrid Margin="10" ShowAdvancedOptions="True" ShowDescriptionByTooltip="True"
  258. FontSize="14" ShowTitle="False" ShowSortOptions="False" ShowSearchBox="False"
  259. AutoGenerateProperties="False"
  260. CategoryGroupHeaderTemplate="{DynamicResource Category}" SelectedObject="{Binding SelectedItem,ElementName=PageList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" >
  261. <mypro:PropertyGrid.PropertyDefinitions>
  262. <mypro:PropertyDefinition Name="FontSize" ></mypro:PropertyDefinition>
  263. <mypro:PropertyDefinition DisplayName="页面名称" Category="页面属性" DisplayOrder="1" Name="Name" Description="页面名称"/>
  264. <mypro:PropertyDefinition DisplayName="菜单名称" Category="页面属性" DisplayOrder="2" Name="MenuName" Description="菜单名称"/>
  265. </mypro:PropertyGrid.PropertyDefinitions>
  266. </mypro:PropertyGrid>
  267. </TabItem>
  268. <TabItem Header="属性设置">
  269. <mypro:PropertyGrid Margin="10" ShowAdvancedOptions="True" ShowDescriptionByTooltip="True"
  270. FontSize="14" ShowTitle="False" ShowSortOptions="False" ShowSearchBox="False"
  271. AutoGenerateProperties="False"
  272. CategoryGroupHeaderTemplate="{DynamicResource Category}" SelectedObject="{Binding SelectedItem,ElementName=cav,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" >
  273. <mypro:PropertyGrid.PropertyDefinitions>
  274. <mypro:PropertyDefinition Name="FontSize" ></mypro:PropertyDefinition>
  275. <mypro:PropertyDefinition DisplayName="名称" Category="基本属性" DisplayOrder="0" Name="Name" Description="设置控件的标识,可以在Js脚本中通过标识操作控件。"/>
  276. <mypro:PropertyDefinition DisplayName="内容" Category="基本属性" DisplayOrder="1" Name="Content"/>
  277. <mypro:PropertyDefinition DisplayName="标题" Category="基本属性" DisplayOrder="1" Name="Header" Description="Header"/>
  278. <mypro:PropertyDefinition DisplayName="文本" Category="基本属性" DisplayOrder="1" Name="Text" Description="Text"/>
  279. <mypro:PropertyDefinition DisplayName="值" Category="基本属性" DisplayOrder="2" Name="NumberValue" Description="NumberValue"/>
  280. <mypro:PropertyDefinition DisplayName="数值" Category="基本属性" DisplayOrder="2" Name="CurValue" Description="CurValue"/>
  281. <mypro:PropertyDefinition DisplayName="状态值" Category="基本属性" DisplayOrder="2" Name="StatusValue" Description="StatusValue"/>
  282. <mypro:PropertyDefinition DisplayName="勾选状态" Category="基本属性" DisplayOrder="2" Name="IsChecked" Description="IsChecked"/>
  283. <mypro:PropertyDefinition DisplayName="数值" Category="基本属性" DisplayOrder="2" Name="Value" Description="Value"/>
  284. <mypro:PropertyDefinition DisplayName="物料重量(g)" Category="基本属性" DisplayOrder="2" Name="KgValue" Description="克数"/>
  285. <mypro:PropertyDefinition DisplayName="物料描述" Category="基本属性" DisplayOrder="2" Name="WLText" Description="物料描述"/>
  286. <mypro:PropertyDefinition DisplayName="物料标题" Category="基本属性" DisplayOrder="2" Name="WLTitle" Description="物料标题"/>
  287. <mypro:PropertyDefinition DisplayName="标题" Category="基本属性" DisplayOrder="2" Name="Title" Description="标题"/>
  288. <mypro:PropertyDefinition DisplayName="运行状态" Category="基本属性" DisplayOrder="2" Name="Direction" Description="Direction"/>
  289. <mypro:PropertyDefinition DisplayName="Tag" Category="基本属性" DisplayOrder="2" Name="Tag" Description="Tag"/>
  290. <mypro:PropertyDefinition DisplayName="启动路径" Category="基本属性" DisplayOrder="2" Name="StartPath" Description="StartPath"/>
  291. <mypro:PropertyDefinition DisplayName="消息类型" Category="基本属性" DisplayOrder="2" Name="MessageLX" Description="MessageLX"/>
  292. <mypro:PropertyDefinition DisplayName="最大值" Category="基本属性" DisplayOrder="3" Name="MaxValue" Description="MaxValue"/>
  293. <mypro:PropertyDefinition DisplayName="最小值" Category="基本属性" DisplayOrder="3" Name="MinValue" Description="MinValue"/>
  294. <mypro:PropertyDefinition DisplayName="最大值" Category="基本属性" DisplayOrder="3" Name="Maximum" Description="Maximum"/>
  295. <mypro:PropertyDefinition DisplayName="最小值" Category="基本属性" DisplayOrder="3" Name="Minimum" Description="Minimum"/>
  296. <mypro:PropertyDefinition DisplayName="间隔" Category="基本属性" DisplayOrder="3" Name="Interval"/>
  297. <mypro:PropertyDefinition DisplayName="宽度" Category="基本属性" DisplayOrder="3" Name="Width"/>
  298. <mypro:PropertyDefinition DisplayName="高度" Category="基本属性" DisplayOrder="3" Name="Height"/>
  299. <mypro:PropertyDefinition DisplayName="勾选状态" Category="基本属性" DisplayOrder="3" Name="BindingIsChecked"/>
  300. <mypro:PropertyDefinition DisplayName="图片路径" Category="基本属性" DisplayOrder="3" Name="ImageStartPath" />
  301. <mypro:PropertyDefinition DisplayName="FontSize" Category="基本属性" DisplayOrder="4" Name="FontSize"/>
  302. <mypro:PropertyDefinition DisplayName="字体" Category="基本属性" DisplayOrder="4" Name="FontFamily"/>
  303. <mypro:PropertyDefinition DisplayName="字体样式" Category="基本属性" DisplayOrder="4" Name="FontWeight"/>
  304. <mypro:PropertyDefinition DisplayName="斜体" Category="基本属性" DisplayOrder="4" Name="FontStyle"/>
  305. <mypro:PropertyDefinition DisplayName="下划线" Category="基本属性" DisplayOrder="4" Name="TextDecorations"/>
  306. <mypro:PropertyDefinition DisplayName="文字环绕样式" Category="基本属性" DisplayOrder="4" Name="TextWrapping"/>
  307. <mypro:PropertyDefinition DisplayName="是否使能" Category="基本属性" DisplayOrder="5" Name="IsEnabled"/>
  308. <mypro:PropertyDefinition DisplayName="是否显示" Category="基本属性" DisplayOrder="5" Name="Visibility"/>
  309. <mypro:PropertyDefinition DisplayName="回车换行" Category="基本属性" DisplayOrder="5" Name="AcceptsReturn"/>
  310. <mypro:PropertyDefinition DisplayName="鼠标样式" Category="基本属性" DisplayOrder="5" Name="Cursor"/>
  311. <mypro:PropertyDefinition DisplayName="键盘触发顺序" Category="基本属性" DisplayOrder="5" Name="TabIndex"/>
  312. <mypro:PropertyDefinition DisplayName="控件透明度" Category="基本属性" DisplayOrder="5" Name="Opacity"/>
  313. <mypro:PropertyDefinition DisplayName="垂直滚动条" Category="基本属性" DisplayOrder="6" Name="VerticalScrollBarVisibility"/>
  314. <mypro:PropertyDefinition DisplayName="水平滚动条" Category="基本属性" DisplayOrder="6" Name="HorizontalScrollBarVisibility"/>
  315. <mypro:PropertyDefinition DisplayName="是否ESC触发" Category="基本属性" DisplayOrder="7" Name="IsCancel"/>
  316. <mypro:PropertyDefinition DisplayName="是否Enter触发" Category="基本属性" DisplayOrder="7" Name="IsDefault"/>
  317. <mypro:PropertyDefinition DisplayName="垂直对齐" Category="基本属性" DisplayOrder="8" Name="VerticalContentAlignment"/>
  318. <mypro:PropertyDefinition DisplayName="水平对齐" Category="基本属性" DisplayOrder="8" Name="HorizontalContentAlignment"/>
  319. <mypro:PropertyDefinition DisplayName="所属分组" Category="基本属性" DisplayOrder="9" Name="GroupName"/>
  320. <mypro:PropertyDefinition DisplayName="文本提示" Category="基本属性" DisplayOrder="9" Name="ToolTip"/>
  321. <mypro:PropertyDefinition DisplayName="左边距" Category="基本属性" DisplayOrder="9" Name="(Canvas.Left)"/>
  322. <mypro:PropertyDefinition DisplayName="上边距" Category="基本属性" DisplayOrder="9" Name="(Canvas.Top)"/>
  323. <mypro:PropertyDefinition DisplayName="启动测试" Category="基本属性" DisplayOrder="9" Name="TestData"/>
  324. <mypro:PropertyDefinition DisplayName="气缸左执行" Category="基本属性" DisplayOrder="10" Name="LeftTogIsChecked"/>
  325. <mypro:PropertyDefinition DisplayName="气缸右执行" Category="基本属性" DisplayOrder="10" Name="RightTogIsChecked"/>
  326. <mypro:PropertyDefinition DisplayName="背景透明" Category="基本属性" DisplayOrder="10" Name="IsCheckedColor"/>
  327. <mypro:PropertyDefinition DisplayName="边框宽度" Category="基本属性" DisplayOrder="10" Name="BKThickness"/>
  328. <mypro:PropertyDefinition DisplayName="虚线绘制" Category="基本属性" DisplayOrder="10" Name="BKStrokeDashArray"/>
  329. <mypro:PropertyDefinition DisplayName="边框粗细" Category="基本属性" DisplayOrder="11" Name="WaveThickness"/>
  330. <mypro:PropertyDefinition DisplayName="边框粗细" Category="基本属性" DisplayOrder="11" Name="StrokeThickness"/>
  331. <mypro:PropertyDefinition DisplayName="边框粗细" Category="基本属性" DisplayOrder="11" Name="BorderThickness"/>
  332. <mypro:PropertyDefinition DisplayName="布局方向" Category="基本属性" DisplayOrder="11" Name="Orientation"/>
  333. <mypro:PropertyDefinition DisplayName="数据来源类型" Category="数据绑定模块" DisplayOrder="0" Name="DataSouceType"/>
  334. <mypro:PropertyDefinition DisplayName="设备名称" Category="数据绑定模块" DisplayOrder="0" Name="DeviceName"/>
  335. <mypro:PropertyDefinition DisplayName="接口类型" Category="数据绑定模块" DisplayOrder="1" Name="InterfaceMode"/>
  336. <mypro:PropertyDefinition DisplayName="接口参数" Category="数据绑定模块" DisplayOrder="2" Name="InterfaceParameters"/>
  337. <mypro:PropertyDefinition DisplayName="连接信息" Category="数据绑定模块" DisplayOrder="3" Name="DataSouceInformation"/>
  338. <mypro:PropertyDefinition DisplayName="设备解析变量" Category="数据绑定模块" DisplayOrder="4" Name="DeviceValuleName"/>
  339. <mypro:PropertyDefinition DisplayName="模拟运行" Category="数据绑定模块" DisplayOrder="4" Name="IsRun"/>
  340. <mypro:PropertyDefinition DisplayName="数据源" Category="数据绑定模块" DisplayOrder="5" Name="FDataSouce"/>
  341. <mypro:PropertyDefinition DisplayName="代码过滤脚本" Category="数据绑定模块" DisplayOrder="6" Name="Code"/>
  342. <mypro:PropertyDefinition DisplayName="数据结果" Category="数据绑定模块" DisplayOrder="7" Name="GenerateData"/>
  343. <mypro:PropertyDefinition DisplayName="定时间隔" Category="数据绑定模块" DisplayOrder="8" Name="TimeCount"/>
  344. <mypro:PropertyDefinition DisplayName="列表项" Category="集合设置" Name="ItemsString" />
  345. <mypro:PropertyDefinition DisplayName="列表项" Category="集合设置" Name="TabItems" />
  346. <mypro:PropertyDefinition DisplayName="子控件模板" Category="集合设置" Name="ChildTemplateXml" />
  347. <mypro:PropertyDefinition DisplayName="前景色" Category="颜色设置" Name="Foreground"/>
  348. <mypro:PropertyDefinition DisplayName="背景色" Category="颜色设置" Name="Background"/>
  349. <mypro:PropertyDefinition DisplayName="填充颜色" Category="颜色设置" Name="BJColor"/>
  350. <mypro:PropertyDefinition DisplayName="选中色" Category="颜色设置" Name="DKColor"/>
  351. <mypro:PropertyDefinition DisplayName="边框色" Category="颜色设置" Name="BorderBrush"/>
  352. <mypro:PropertyDefinition DisplayName="填充" Category="颜色设置" DisplayOrder="5" Name="WaveFill"/>
  353. <mypro:PropertyDefinition DisplayName="边框" Category="颜色设置" DisplayOrder="5" Name="WaveStroke"/>
  354. <mypro:PropertyDefinition DisplayName="填充" Category="颜色设置" DisplayOrder="5" Name="Fill"/>
  355. <mypro:PropertyDefinition DisplayName="边框" Category="颜色设置" DisplayOrder="5" Name="Stroke"/>
  356. <mypro:PropertyDefinition DisplayName="点击事件" Category="事件绑定" DisplayOrder="0" Name="ClickExec" />
  357. <mypro:PropertyDefinition DisplayName="值改变事件" Category="事件绑定" DisplayOrder="1" Name="ValueChangedExecute" />
  358. <mypro:PropertyDefinition DisplayName="定时触发" Category="事件绑定" DisplayOrder="2" Name="TikcExecute" />
  359. <mypro:PropertyDefinition DisplayName="勾选事件" Category="事件绑定" DisplayOrder="3" Name="CheckedExec" />
  360. <mypro:PropertyDefinition DisplayName="取消勾选事件" Category="事件绑定" DisplayOrder="4" Name="UnCheckedExec" />
  361. <mypro:PropertyDefinition DisplayName="接收消息集" Category="事件绑定" DisplayOrder="5" Name="EventReceiveNameList" />
  362. <mypro:PropertyDefinition DisplayName="出料单击事件" Category="事件绑定" DisplayOrder="6" Name="ChuLiaoExecute" />
  363. <mypro:PropertyDefinition DisplayName="停止出料单击事件" Category="事件绑定" DisplayOrder="7" Name="StopChuLiaoExecute" />
  364. </mypro:PropertyGrid.PropertyDefinitions>
  365. <mypro:PropertyGrid.EditorDefinitions>
  366. <mypro:EditorTemplateDefinition TargetProperties="Opacity">
  367. <mypro:EditorTemplateDefinition.EditingTemplate>
  368. <DataTemplate>
  369. <Slider Maximum="1" Minimum="0" Value="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ></Slider>
  370. </DataTemplate>
  371. </mypro:EditorTemplateDefinition.EditingTemplate>
  372. </mypro:EditorTemplateDefinition>
  373. <mypro:EditorTemplateDefinition TargetProperties="Foreground,Background,BorderBrush,WaveFill,WaveStroke,Fill,Stroke,BJColor,DKColor">
  374. <mypro:EditorTemplateDefinition.EditingTemplate>
  375. <DataTemplate>
  376. <mypro:ColorPicker SelectedColor="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, Converter={x:Static s:ColorToStringConverter.Instance}}" />
  377. </DataTemplate>
  378. </mypro:EditorTemplateDefinition.EditingTemplate>
  379. </mypro:EditorTemplateDefinition>
  380. <mypro:EditorTemplateDefinition TargetProperties="ImageStartPath">
  381. <mypro:EditorTemplateDefinition.EditingTemplate>
  382. <DataTemplate>
  383. <Grid>
  384. <Grid.ColumnDefinitions>
  385. <ColumnDefinition Width="*"/>
  386. <ColumnDefinition Width="35"/>
  387. </Grid.ColumnDefinitions>
  388. <ToggleButton Grid.Column="1" Height="20" Content="..." Width="26" Margin="5,0,0,0" HorizontalAlignment="Left" Click="LJToggleButton_Click"></ToggleButton>
  389. <TextBox Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/>
  390. </Grid>
  391. </DataTemplate>
  392. </mypro:EditorTemplateDefinition.EditingTemplate>
  393. </mypro:EditorTemplateDefinition>
  394. <mypro:EditorTemplateDefinition TargetProperties="StartPath">
  395. <mypro:EditorTemplateDefinition.EditingTemplate>
  396. <DataTemplate>
  397. <Grid>
  398. <Grid.ColumnDefinitions>
  399. <ColumnDefinition Width="*"/>
  400. <ColumnDefinition Width="35"/>
  401. </Grid.ColumnDefinitions>
  402. <ToggleButton Grid.Column="1" Height="20" Content="选择" Width="26" Margin="5,0,0,0" HorizontalAlignment="Left" Click="XZToggleButton_Click"></ToggleButton>
  403. <TextBox Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/>
  404. </Grid>
  405. </DataTemplate>
  406. </mypro:EditorTemplateDefinition.EditingTemplate>
  407. </mypro:EditorTemplateDefinition>
  408. <!--子控件模板编辑-->
  409. <mypro:EditorTemplateDefinition TargetProperties="ChildTemplateXml">
  410. <mypro:EditorTemplateDefinition.EditingTemplate>
  411. <DataTemplate>
  412. <Grid>
  413. <ToggleButton Grid.Column="1" Height="30" Content=" 设置控件模板 " Margin="5,0,0,0" Click="ChildToggleButton_Click"></ToggleButton>
  414. <TextBox Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" Visibility="Collapsed"/>
  415. </Grid>
  416. </DataTemplate>
  417. </mypro:EditorTemplateDefinition.EditingTemplate>
  418. </mypro:EditorTemplateDefinition>
  419. <!--代码绑定模块-->
  420. <mypro:EditorTemplateDefinition TargetProperties="ClickStr,ClickExec,ValueChangedExecute,TikcExecute,CheckedExec,UnCheckedExec,ChuLiaoExecute,StopChuLiaoExecute" >
  421. <mypro:EditorTemplateDefinition.EditingTemplate>
  422. <DataTemplate>
  423. <Grid>
  424. <Grid.ColumnDefinitions>
  425. <ColumnDefinition Width="*"/>
  426. <ColumnDefinition Width="40"/>
  427. </Grid.ColumnDefinitions>
  428. <ToggleButton Grid.Column="1" Height="20" Content="编辑" Width="30" Margin="5,0,5,0" HorizontalAlignment="Left" Click="ToggleButton_Click"></ToggleButton>
  429. <TextBox Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/>
  430. </Grid>
  431. </DataTemplate>
  432. </mypro:EditorTemplateDefinition.EditingTemplate>
  433. </mypro:EditorTemplateDefinition>
  434. <mypro:EditorTemplateDefinition TargetProperties="Code" >
  435. <mypro:EditorTemplateDefinition.EditingTemplate>
  436. <DataTemplate>
  437. <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
  438. <TextBox Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" AcceptsReturn="True" TextWrapping="Wrap"></TextBox>
  439. </ScrollViewer>
  440. </DataTemplate>
  441. </mypro:EditorTemplateDefinition.EditingTemplate>
  442. </mypro:EditorTemplateDefinition>
  443. <mypro:EditorTemplateDefinition TargetProperties="IsRun,IsChecked" >
  444. <mypro:EditorTemplateDefinition.EditingTemplate>
  445. <DataTemplate>
  446. <StackPanel Grid.Column="1" Orientation="Horizontal">
  447. <CheckBox Margin="10,0,0,0" VerticalAlignment="Center" IsChecked="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></CheckBox>
  448. <ToggleButton Grid.Column="1" Height="20" Content="绑定" Width="30" Margin="20,0,0,0" HorizontalAlignment="Left" Click="BingToggleButton_Click"></ToggleButton>
  449. <ToggleButton Height="20" Content="解绑" Width="30" Margin="5,0,0,0" HorizontalAlignment="Right" Click="ClearBingToggleButton_Click"></ToggleButton>
  450. </StackPanel>
  451. </DataTemplate>
  452. </mypro:EditorTemplateDefinition.EditingTemplate>
  453. </mypro:EditorTemplateDefinition>
  454. <mypro:EditorTemplateDefinition TargetProperties="DeviceName" >
  455. <mypro:EditorTemplateDefinition.EditingTemplate>
  456. <DataTemplate>
  457. <ComboBox Grid.Column="1" Height="25" Width="{Binding Width, ElementName=com}" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
  458. ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=UserControl},Path=DataContext.DevNameList}"
  459. ></ComboBox>
  460. </DataTemplate>
  461. </mypro:EditorTemplateDefinition.EditingTemplate>
  462. </mypro:EditorTemplateDefinition>
  463. <mypro:EditorTemplateDefinition TargetProperties="Text,Title,Value,BindingIsChecked,Header,KgValue,WLText,WLTitle,DataSouceInformation,Direction,LeftTogIsChecked,RightTogIsChecked" >
  464. <mypro:EditorTemplateDefinition.EditingTemplate>
  465. <DataTemplate>
  466. <!--此处可自由发挥-->
  467. <Grid >
  468. <Grid.ColumnDefinitions>
  469. <ColumnDefinition Width="*"/>
  470. <ColumnDefinition Width="40"/>
  471. </Grid.ColumnDefinitions>
  472. <TextBox Grid.Row="2" x:Name="wenben" Padding="5" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap"></TextBox>
  473. <StackPanel Grid.Column="1">
  474. <ToggleButton Grid.Column="1" Height="20" Content="绑定" Width="30" Margin="5,0,5,0" HorizontalAlignment="Left" Click="BingToggleButton_Click"></ToggleButton>
  475. <ToggleButton Height="20" Content="解绑" Width="30" Margin="5,2,5,0" HorizontalAlignment="Right" Click="ClearBingToggleButton_Click"></ToggleButton>
  476. </StackPanel>
  477. </Grid>
  478. </DataTemplate>
  479. </mypro:EditorTemplateDefinition.EditingTemplate>
  480. </mypro:EditorTemplateDefinition>
  481. </mypro:PropertyGrid.EditorDefinitions>
  482. </mypro:PropertyGrid>
  483. </TabItem>
  484. <TabItem Header="原生属性" Visibility="{Binding ElementName=IsYSSX, Path=IsChecked, Converter={x:Static s:BoolToVisibilityConverter.Instance}}">
  485. <mypro:PropertyGrid Margin="10" ShowAdvancedOptions="True" ShowDescriptionByTooltip="True"
  486. FontSize="14" ShowTitle="False" ShowSortOptions="False" ShowSearchBox="False"
  487. CategoryGroupHeaderTemplate="{DynamicResource Category}" SelectedObject="{Binding SelectedItem,ElementName=cav,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
  488. </TabItem>
  489. </TabControl>
  490. </Grid>
  491. </Grid>
  492. </UserControl>