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

388 lines
32 KiB

  1. <Window x:Name="window" x:Class="BeDesignerSCADA.MainWindow"
  2. xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  3. xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  4. xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
  5. xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
  6. xmlns:local="clr-namespace:BeDesignerSCADA"
  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:ctl="clr-namespace:BeDesignerSCADA.Controls"
  11. xmlns:mypro="http://schemas.xceed.com/wpf/xaml/toolkit"
  12. mc:Ignorable="d"
  13. WindowStartupLocation="CenterScreen"
  14. Title="黑菠萝科技-[组态软件1.0]" Height="900" Width="1400" Icon="/Images/ico.ico" >
  15. <Window.Resources>
  16. <ResourceDictionary>
  17. <ResourceDictionary.MergedDictionaries>
  18. <ResourceDictionary Source="/BeDesignerSCADA;component/Themes/Styles.xaml" />
  19. <ResourceDictionary Source="/BPASmartClient.SCADAControl;component/Themes/Generic.xaml" />
  20. </ResourceDictionary.MergedDictionaries>
  21. </ResourceDictionary>
  22. </Window.Resources>
  23. <Grid x:Name="grid">
  24. <Grid.ColumnDefinitions>
  25. <ColumnDefinition Width="240"/>
  26. <ColumnDefinition/>
  27. <ColumnDefinition Width="350"/>
  28. </Grid.ColumnDefinitions>
  29. <!--左侧选择区域-->
  30. <Grid >
  31. <Border BorderThickness="1" BorderBrush="{StaticResource AccentBrush}" Margin="4">
  32. <ListBox x:Name="CtlList" Background="Transparent" ItemTemplate="{DynamicResource ToolBoxStyle}" BorderThickness="0" PreviewMouseMove="CtlList_PreviewMouseMove">
  33. </ListBox>
  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="SaveBtn" Margin="16 0 0 0" Padding="0" Click="SaveBtn_Click">
  102. <StackPanel Orientation="Horizontal" Margin="8 0">
  103. <icon:PackIconModern Kind="Save" VerticalAlignment="Center" Width="12"/>
  104. <TextBlock Text="保存" Margin="4 0" VerticalAlignment="Center"/>
  105. </StackPanel>
  106. </Button>
  107. <Button x:Name="LoadBtn" Margin="4 0 0 0" Padding="0" Click="LoadBtn_Click">
  108. <StackPanel Orientation="Horizontal" Margin="8 0">
  109. <icon:PackIconModern Kind="DiskDownload" VerticalAlignment="Center" Width="14"/>
  110. <TextBlock Text="加载" Margin="4 0" VerticalAlignment="Center"/>
  111. </StackPanel>
  112. </Button>
  113. <Button x:Name="MNBtn" Margin="4 0 0 0" Padding="0" Click="MNBtn_Click">
  114. <StackPanel Orientation="Horizontal" Margin="8 0">
  115. <icon:PackIconModern Kind="MessageSend" VerticalAlignment="Center" Width="14"/>
  116. <TextBlock Text="模拟消息" Margin="4 0" VerticalAlignment="Center"/>
  117. </StackPanel>
  118. </Button>
  119. <ToggleButton x:Name="showCode" Click="showCode_Click" DockPanel.Dock="Right" Margin="4 0 0 0" Padding="4 0">
  120. <icon:Material Kind="FileCode"/>
  121. </ToggleButton>
  122. <Slider DockPanel.Dock="Right" Width="100" Maximum="16" Minimum="1" Margin="4 0 0 0"
  123. HorizontalContentAlignment="Center" Value="{Binding ElementName=cav,Path=GridPxiel}" ></Slider>
  124. <TextBlock DockPanel.Dock="Right" Text="对齐:" VerticalAlignment="Center" Margin="16 0 0 0"/>
  125. </DockPanel>
  126. <!--中间画布-->
  127. <Border BorderThickness="1" BorderBrush="{StaticResource AccentBrush}" Margin="4">
  128. <Border.Background>
  129. <ImageBrush ImageSource="/Images/bj.png" Stretch="UniformToFill"/>
  130. </Border.Background>
  131. <Grid>
  132. <Grid.ColumnDefinitions>
  133. <ColumnDefinition/>
  134. <ColumnDefinition Width="auto"/>
  135. </Grid.ColumnDefinitions>
  136. <ctl:CanvasPanel x:Name="cav" 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">
  137. <ctl:CanvasPanel.Background>
  138. <VisualBrush TileMode="Tile" Viewport="0,0,20,20" ViewportUnits="Absolute">
  139. <VisualBrush.Visual>
  140. <Rectangle Width="20" Height="20" StrokeDashArray="4,2" StrokeThickness="0.5" Stroke="#CBCBCB">
  141. <Rectangle.Style>
  142. <Style TargetType="{x:Type Rectangle}">
  143. <Style.Triggers>
  144. <DataTrigger Binding="{Binding UseAutoAlignment, RelativeSource={RelativeSource AncestorType={x:Type ctl:CanvasPanel}, Mode=FindAncestor}}" Value="True">
  145. <Setter Property="Visibility" Value="Visible"/>
  146. </DataTrigger>
  147. <DataTrigger Binding="{Binding UseAutoAlignment, RelativeSource={RelativeSource AncestorType={x:Type ctl:CanvasPanel}, Mode=FindAncestor}}" Value="False">
  148. <Setter Property="Visibility" Value="Collapsed"/>
  149. </DataTrigger>
  150. </Style.Triggers>
  151. </Style>
  152. </Rectangle.Style>
  153. </Rectangle>
  154. </VisualBrush.Visual>
  155. </VisualBrush>
  156. </ctl:CanvasPanel.Background>
  157. <ctl:CanvasPanel.RenderTransform>
  158. <TransformGroup>
  159. <TranslateTransform x:Name="CanvasTranslate"/>
  160. </TransformGroup>
  161. </ctl:CanvasPanel.RenderTransform>
  162. </ctl:CanvasPanel>
  163. <ctl:RunCanvas x:Name="runCanvas" Visibility="{Binding RunCanvasVisibility}" />
  164. <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}}"/>
  165. </Grid>
  166. </Border>
  167. </DockPanel>
  168. <GridSplitter HorizontalAlignment="Right" Grid.Column="1" VerticalAlignment="Stretch" Width="5" Background="Transparent"/>
  169. <!--右侧属性栏-->
  170. <Grid Grid.Column="2">
  171. <TabControl SelectedIndex="0">
  172. <TabItem Header="属性设置">
  173. <mypro:PropertyGrid Margin="10" ShowAdvancedOptions="True" ShowDescriptionByTooltip="True"
  174. FontSize="14" ShowTitle="False" ShowSortOptions="False" ShowSearchBox="False"
  175. AutoGenerateProperties="False"
  176. CategoryGroupHeaderTemplate="{DynamicResource Category}" SelectedObject="{Binding SelectedItem,ElementName=cav,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" >
  177. <mypro:PropertyGrid.PropertyDefinitions>
  178. <mypro:PropertyDefinition Name="FontSize" ></mypro:PropertyDefinition>
  179. <mypro:PropertyDefinition DisplayName="名称" Category="基本属性" DisplayOrder="0" Name="Name" Description="设置控件的标识,可以在Js脚本中通过标识操作控件。"/>
  180. <mypro:PropertyDefinition DisplayName="内容" Category="基本属性" DisplayOrder="1" Name="Content"/>
  181. <mypro:PropertyDefinition DisplayName="标题" Category="基本属性" DisplayOrder="1" Name="Header" Description="Header"/>
  182. <mypro:PropertyDefinition DisplayName="文本" Category="基本属性" DisplayOrder="1" Name="Text" Description="Text"/>
  183. <mypro:PropertyDefinition DisplayName="值" Category="基本属性" DisplayOrder="2" Name="NumberValue" Description="NumberValue"/>
  184. <mypro:PropertyDefinition DisplayName="数值" Category="基本属性" DisplayOrder="2" Name="CurValue" Description="CurValue"/>
  185. <mypro:PropertyDefinition DisplayName="状态值" Category="基本属性" DisplayOrder="2" Name="StatusValue" Description="StatusValue"/>
  186. <mypro:PropertyDefinition DisplayName="勾选状态" Category="基本属性" DisplayOrder="2" Name="IsChecked" Description="IsChecked"/>
  187. <mypro:PropertyDefinition DisplayName="数值" Category="基本属性" DisplayOrder="2" Name="Value" Description="Value"/>
  188. <mypro:PropertyDefinition DisplayName="物料重量(g)" Category="基本属性" DisplayOrder="2" Name="KgValue" Description="克数"/>
  189. <mypro:PropertyDefinition DisplayName="物料描述" Category="基本属性" DisplayOrder="2" Name="WLText" Description="物料描述"/>
  190. <mypro:PropertyDefinition DisplayName="物料标题" Category="基本属性" DisplayOrder="2" Name="WLTitle" Description="物料标题"/>
  191. <mypro:PropertyDefinition DisplayName="标题" Category="基本属性" DisplayOrder="2" Name="Title" Description="标题"/>
  192. <mypro:PropertyDefinition DisplayName="最大值" Category="基本属性" DisplayOrder="3" Name="MaxValue" Description="MaxValue"/>
  193. <mypro:PropertyDefinition DisplayName="最小值" Category="基本属性" DisplayOrder="3" Name="MinValue" Description="MinValue"/>
  194. <mypro:PropertyDefinition DisplayName="最大值" Category="基本属性" DisplayOrder="3" Name="Maximum" Description="Maximum"/>
  195. <mypro:PropertyDefinition DisplayName="最小值" Category="基本属性" DisplayOrder="3" Name="Minimum" Description="Minimum"/>
  196. <mypro:PropertyDefinition DisplayName="间隔" Category="基本属性" DisplayOrder="3" Name="Interval"/>
  197. <mypro:PropertyDefinition DisplayName="宽度" Category="基本属性" DisplayOrder="3" Name="Width"/>
  198. <mypro:PropertyDefinition DisplayName="高度" Category="基本属性" DisplayOrder="3" Name="Height"/>
  199. <mypro:PropertyDefinition DisplayName="勾选状态" Category="基本属性" DisplayOrder="3" Name="BindingIsChecked"/>
  200. <mypro:PropertyDefinition DisplayName="路径" Category="基本属性" DisplayOrder="3" Name="Source" />
  201. <mypro:PropertyDefinition DisplayName="字体大小" Category="基本属性" DisplayOrder="4" Name="FontSize"/>
  202. <mypro:PropertyDefinition DisplayName="字体" Category="基本属性" DisplayOrder="4" Name="FontFamily"/>
  203. <mypro:PropertyDefinition DisplayName="字体样式" Category="基本属性" DisplayOrder="4" Name="FontWeight"/>
  204. <mypro:PropertyDefinition DisplayName="垂直对齐" Category="基本属性" DisplayOrder="4" Name="VerticalContentAlignment"/>
  205. <mypro:PropertyDefinition DisplayName="水平对齐" Category="基本属性" DisplayOrder="4" Name="HorizontalContentAlignment"/>
  206. <mypro:PropertyDefinition DisplayName="所属分组" Category="基本属性" DisplayOrder="4" Name="GroupName"/>
  207. <mypro:PropertyDefinition DisplayName="文本提示" Category="基本属性" DisplayOrder="4" Name="ToolTip"/>
  208. <mypro:PropertyDefinition DisplayName="左边距" Category="基本属性" DisplayOrder="4" Name="(Canvas.Left)"/>
  209. <mypro:PropertyDefinition DisplayName="上边距" Category="基本属性" DisplayOrder="4" Name="(Canvas.Top)"/>
  210. <mypro:PropertyDefinition DisplayName="数据来源类型" Category="数据绑定模块" DisplayOrder="0" Name="DataSouceType"/>
  211. <mypro:PropertyDefinition DisplayName="设备名称" Category="数据绑定模块" DisplayOrder="0" Name="DeviceName"/>
  212. <mypro:PropertyDefinition DisplayName="接口类型" Category="数据绑定模块" DisplayOrder="1" Name="InterfaceMode"/>
  213. <mypro:PropertyDefinition DisplayName="接口参数" Category="数据绑定模块" DisplayOrder="2" Name="InterfaceParameters"/>
  214. <mypro:PropertyDefinition DisplayName="连接信息" Category="数据绑定模块" DisplayOrder="3" Name="DataSouceInformation"/>
  215. <mypro:PropertyDefinition DisplayName="设备解析变量" Category="数据绑定模块" DisplayOrder="4" Name="DeviceValuleName"/>
  216. <mypro:PropertyDefinition DisplayName="数据源" Category="数据绑定模块" DisplayOrder="5" Name="FDataSouce"/>
  217. <mypro:PropertyDefinition DisplayName="代码过滤脚本" Category="数据绑定模块" DisplayOrder="6" Name="Code"/>
  218. <mypro:PropertyDefinition DisplayName="数据结果" Category="数据绑定模块" DisplayOrder="7" Name="GenerateData"/>
  219. <mypro:PropertyDefinition DisplayName="定时间隔" Category="数据绑定模块" DisplayOrder="8" Name="TimeCount"/>
  220. <mypro:PropertyDefinition DisplayName="列表项" Category="集合设置" Name="ItemsString" />
  221. <mypro:PropertyDefinition DisplayName="列表项" Category="集合设置" Name="TabItems" />
  222. <mypro:PropertyDefinition DisplayName="前景色" Category="颜色设置" Name="Foreground"/>
  223. <mypro:PropertyDefinition DisplayName="背景色" Category="颜色设置" Name="Background"/>
  224. <mypro:PropertyDefinition DisplayName="边框色" Category="颜色设置" Name="BorderBrush"/>
  225. <mypro:PropertyDefinition DisplayName="填充" Category="基本属性" DisplayOrder="5" Name="WaveFill"/>
  226. <mypro:PropertyDefinition DisplayName="边框粗细" Category="基本属性" DisplayOrder="5" Name="WaveThickness"/>
  227. <mypro:PropertyDefinition DisplayName="边框" Category="基本属性" DisplayOrder="5" Name="WaveStroke"/>
  228. <mypro:PropertyDefinition DisplayName="填充" Category="基本属性" DisplayOrder="5" Name="Fill"/>
  229. <mypro:PropertyDefinition DisplayName="边框" Category="基本属性" DisplayOrder="5" Name="Stroke"/>
  230. <mypro:PropertyDefinition DisplayName="边框粗细" Category="基本属性" DisplayOrder="5" Name="StrokeThickness"/>
  231. <mypro:PropertyDefinition DisplayName="边框粗细" Category="基本属性" DisplayOrder="5" Name="BorderThickness"/>
  232. <mypro:PropertyDefinition DisplayName="点击事件" Category="事件绑定" DisplayOrder="0" Name="ClickExec" />
  233. <mypro:PropertyDefinition DisplayName="值改变事件" Category="事件绑定" DisplayOrder="1" Name="ValueChangedExecute" />
  234. <mypro:PropertyDefinition DisplayName="定时触发" Category="事件绑定" DisplayOrder="2" Name="TikcExecute" />
  235. <mypro:PropertyDefinition DisplayName="勾选事件" Category="事件绑定" DisplayOrder="3" Name="CheckedExec" />
  236. <mypro:PropertyDefinition DisplayName="取消勾选事件" Category="事件绑定" DisplayOrder="4" Name="UnCheckedExec" />
  237. <mypro:PropertyDefinition DisplayName="接收消息集" Category="事件绑定" DisplayOrder="5" Name="EventReceiveNameList" />
  238. <mypro:PropertyDefinition DisplayName="出料单击事件" Category="事件绑定" DisplayOrder="6" Name="出料单击事件" />
  239. <mypro:PropertyDefinition DisplayName="停止出料单击事件" Category="事件绑定" DisplayOrder="7" Name="停止出料单击事件" />
  240. </mypro:PropertyGrid.PropertyDefinitions>
  241. <mypro:PropertyGrid.EditorDefinitions>
  242. <mypro:EditorTemplateDefinition TargetProperties="Foreground,Background,BorderBrush,WaveFill,WaveStroke,Fill,Stroke">
  243. <mypro:EditorTemplateDefinition.EditingTemplate>
  244. <DataTemplate>
  245. <!--此处可自由发挥-->
  246. <Grid>
  247. <mypro:ColorPicker SelectedColor="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, Converter={x:Static s:ColorToStringConverter.Instance}}" />
  248. </Grid>
  249. </DataTemplate>
  250. </mypro:EditorTemplateDefinition.EditingTemplate>
  251. </mypro:EditorTemplateDefinition>
  252. <mypro:EditorTemplateDefinition TargetProperties="Source">
  253. <mypro:EditorTemplateDefinition.EditingTemplate>
  254. <DataTemplate>
  255. <Grid>
  256. <Grid.ColumnDefinitions>
  257. <ColumnDefinition Width="*"/>
  258. <ColumnDefinition Width="35"/>
  259. </Grid.ColumnDefinitions>
  260. <ToggleButton Grid.Column="1" Height="30" Content="..." Width="26" Margin="5,0,0,0" HorizontalAlignment="Left" Click="LJToggleButton_Click"></ToggleButton>
  261. <TextBox Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/>
  262. </Grid>
  263. </DataTemplate>
  264. </mypro:EditorTemplateDefinition.EditingTemplate>
  265. </mypro:EditorTemplateDefinition>
  266. <!--代码绑定模块-->
  267. <mypro:EditorTemplateDefinition TargetProperties="ClickExec,ValueChangedExecute,TikcExecute,CheckedExec,UnCheckedExec" >
  268. <mypro:EditorTemplateDefinition.EditingTemplate>
  269. <DataTemplate>
  270. <Grid>
  271. <Grid.ColumnDefinitions>
  272. <ColumnDefinition Width="*"/>
  273. <ColumnDefinition Width="35"/>
  274. </Grid.ColumnDefinitions>
  275. <ToggleButton Grid.Column="1" Height="30" Content="编辑" Width="26" Margin="5,0,0,0" HorizontalAlignment="Left" Click="ToggleButton_Click"></ToggleButton>
  276. <TextBox Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/>
  277. </Grid>
  278. </DataTemplate>
  279. </mypro:EditorTemplateDefinition.EditingTemplate>
  280. </mypro:EditorTemplateDefinition>
  281. <mypro:EditorTemplateDefinition TargetProperties="Code" >
  282. <mypro:EditorTemplateDefinition.EditingTemplate>
  283. <DataTemplate>
  284. <ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
  285. <TextBox Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" AcceptsReturn="True" TextWrapping="Wrap"></TextBox>
  286. </ScrollViewer>
  287. </DataTemplate>
  288. </mypro:EditorTemplateDefinition.EditingTemplate>
  289. </mypro:EditorTemplateDefinition>
  290. <mypro:EditorTemplateDefinition TargetProperties="DeviceValuleName" >
  291. <mypro:EditorTemplateDefinition.EditingTemplate>
  292. <DataTemplate>
  293. <ComboBox Grid.Column="1" Height="25" Width="{Binding Width, ElementName=com}" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
  294. ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window},Path=DataContext.DevValueList}"
  295. ></ComboBox>
  296. </DataTemplate>
  297. </mypro:EditorTemplateDefinition.EditingTemplate>
  298. </mypro:EditorTemplateDefinition>
  299. <mypro:EditorTemplateDefinition TargetProperties="DeviceName" >
  300. <mypro:EditorTemplateDefinition.EditingTemplate>
  301. <DataTemplate>
  302. <ComboBox Grid.Column="1" Height="25" Width="{Binding Width, ElementName=com}" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
  303. ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window},Path=DataContext.DevNameList}"
  304. ></ComboBox>
  305. </DataTemplate>
  306. </mypro:EditorTemplateDefinition.EditingTemplate>
  307. </mypro:EditorTemplateDefinition>
  308. <mypro:EditorTemplateDefinition TargetProperties="Text,Content,Title,Value,BindingIsChecked,Header,KgValue,WLText,WLTitle" >
  309. <mypro:EditorTemplateDefinition.EditingTemplate>
  310. <DataTemplate>
  311. <!--此处可自由发挥-->
  312. <Grid>
  313. <Grid.RowDefinitions>
  314. <RowDefinition/>
  315. <RowDefinition/>
  316. </Grid.RowDefinitions>
  317. <Grid Margin="0,5,0,5">
  318. <Grid.ColumnDefinitions>
  319. <ColumnDefinition Width="40" />
  320. <ColumnDefinition Width="*" x:Name="key"/>
  321. <ColumnDefinition Width="*" x:Name="Text"/>
  322. </Grid.ColumnDefinitions>
  323. <TextBlock>绑定:</TextBlock>
  324. <ComboBox x:Name="namebox" DropDownOpened="namebox_DropDownOpened" Grid.Column="1" Height="25" IsTextSearchEnabled="True" IsEditable="True" Tag="{Binding Text, ElementName=valuebox}" TextBoxBase.TextChanged="ComboBoxName_TextChanged"
  325. ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window},Path=DataContext.DevNameList}">
  326. </ComboBox>
  327. <ComboBox x:Name="valuebox" DropDownOpened="valuebox_DropDownOpened" Grid.Column="2" Height="25" IsTextSearchEnabled="True" IsEditable="True" Tag="{Binding Text, ElementName=namebox}" TextBoxBase.TextChanged="ComboBoxValue_TextChanged"
  328. ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window},Path=DataContext.DevValueList}"/>
  329. </Grid>
  330. <TextBox Grid.Row="2" x:Name="wenben" Padding="5" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap"></TextBox>
  331. </Grid>
  332. </DataTemplate>
  333. </mypro:EditorTemplateDefinition.EditingTemplate>
  334. </mypro:EditorTemplateDefinition>
  335. </mypro:PropertyGrid.EditorDefinitions>
  336. </mypro:PropertyGrid>
  337. </TabItem>
  338. <!--<TabItem Header="所有属性">
  339. <mypro:PropertyGrid x:Name="dsdsdsd"
  340. Margin="10" ShowAdvancedOptions="True" ShowDescriptionByTooltip="True"
  341. FontSize="14" ShowTitle="False" ShowSortOptions="False" ShowSearchBox="False"
  342. CategoryGroupHeaderTemplate="{DynamicResource Category}" SelectedObject="{Binding SelectedItem,ElementName=cav,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" />
  343. </TabItem>-->
  344. </TabControl>
  345. </Grid>
  346. </Grid>
  347. </Window>