|
|
@@ -22,373 +22,7 @@ |
|
|
|
</ResourceDictionary> |
|
|
|
</Window.Resources> |
|
|
|
|
|
|
|
<Grid x:Name="grid"> |
|
|
|
<Grid.ColumnDefinitions> |
|
|
|
<ColumnDefinition Width="240"/> |
|
|
|
<ColumnDefinition/> |
|
|
|
<ColumnDefinition Width="350"/> |
|
|
|
</Grid.ColumnDefinitions> |
|
|
|
|
|
|
|
<!--左侧选择区域--> |
|
|
|
<Grid > |
|
|
|
<Border BorderThickness="1" BorderBrush="{StaticResource AccentBrush}" Margin="4"> |
|
|
|
<ListBox x:Name="CtlList" Background="Transparent" ItemTemplate="{DynamicResource ToolBoxStyle}" BorderThickness="0" PreviewMouseMove="CtlList_PreviewMouseMove"> |
|
|
|
</ListBox> |
|
|
|
</Border> |
|
|
|
</Grid> |
|
|
|
|
|
|
|
<Border x:Name="grid"> |
|
|
|
|
|
|
|
|
|
|
|
<!--中间控制区域--> |
|
|
|
<DockPanel Grid.Column="1"> |
|
|
|
<!--按钮控制--> |
|
|
|
<DockPanel LastChildFill="False" DockPanel.Dock="Top" Height="24" Margin="4 4 4 0"> |
|
|
|
<Button Margin="0" Width="24" Padding="0" Click="AglinLeftBtn_Click" ToolTip="左对齐"> |
|
|
|
<icon:PackIconModern Kind="AlignLeft"/> |
|
|
|
</Button> |
|
|
|
<Button Margin="4 0 0 0" Width="24" Padding="0" Click="AglinRightBtn_Click" ToolTip="右对齐"> |
|
|
|
<icon:PackIconModern Kind="AlignRight"/> |
|
|
|
</Button> |
|
|
|
<Button Margin="4 0 0 0" Width="24" Padding="0" Click="AglinCenterBtn_Click" ToolTip="中心对齐"> |
|
|
|
<icon:PackIconModern Kind="AlignCenter"/> |
|
|
|
</Button> |
|
|
|
<Button Margin="4 0 0 0" Width="24" Padding="0" Click="AglinTopBtn_Click" ToolTip="上对齐"> |
|
|
|
<icon:PackIconModern Kind="BorderTop"/> |
|
|
|
</Button> |
|
|
|
<Button Margin="4 0 0 0" Width="24" Padding="0" Click="AglinBottomBtn_Click" ToolTip="下对齐"> |
|
|
|
<icon:PackIconModern Kind="BorderBottom"/> |
|
|
|
</Button> |
|
|
|
<Button Margin="16 0 0 0" Width="24" Padding="0" Click="HorizontalLayoutBtn_Click" ToolTip="水平分布"> |
|
|
|
<icon:PackIconModern Kind="BorderHorizontal"/> |
|
|
|
</Button> |
|
|
|
<Button Margin="4 0 0 0" Width="24" Padding="0" Click="VerticalLayoutBtn_Click" ToolTip="垂直分布"> |
|
|
|
<icon:PackIconModern Kind="BorderVertical"/> |
|
|
|
</Button> |
|
|
|
|
|
|
|
<ToggleButton IsChecked="{Binding UseAutoAlignment, ElementName=cav, Mode=TwoWay}" ToolTip="使用对齐网格" Margin="4 0 0 0" Width="24" Padding="0"> |
|
|
|
<icon:PackIconModern Kind="CellAlign"/> |
|
|
|
</ToggleButton> |
|
|
|
|
|
|
|
<Button Margin="16 0 0 0" Width="24" Padding="0" ToolTip="复制" Command="{Binding ElementName=cav, Path=CopySelectItemsCommand}"> |
|
|
|
<icon:PackIconModern Kind="PageCopy"/> |
|
|
|
</Button> |
|
|
|
<Button Margin="4 0 0 0" Width="24" Padding="0" ToolTip="粘贴" Command="{Binding ElementName=cav, Path=PasteSelectItemsCommand}"> |
|
|
|
<icon:PackIconModern Kind="ClipboardPaste"/> |
|
|
|
</Button> |
|
|
|
<Button Margin="4 0 0 0" Width="24" Padding="0" ToolTip="删除" Command="{Binding ElementName=cav, Path=DeleteSelectItemsCommand}"> |
|
|
|
<icon:PackIconModern Kind="Delete"/> |
|
|
|
</Button> |
|
|
|
|
|
|
|
<Button x:Name="RunBtn" Margin="16 0 0 0" Padding="0" Click="RunBtn_Click" Command="{Binding RunUiCommand}"> |
|
|
|
<Button.Style> |
|
|
|
<Style TargetType="Button"> |
|
|
|
<Setter Property="Tag" Value="运行"/> |
|
|
|
<Setter Property="Content"> |
|
|
|
<Setter.Value> |
|
|
|
<StackPanel Orientation="Horizontal" Margin="8 0"> |
|
|
|
<icon:PackIconModern Kind="ControlPlay" VerticalAlignment="Center" Foreground="#28B60F" Width="8"/> |
|
|
|
<TextBlock Text="运行" Margin="4 0" VerticalAlignment="Center"/> |
|
|
|
</StackPanel> |
|
|
|
</Setter.Value> |
|
|
|
</Setter> |
|
|
|
<Style.Triggers> |
|
|
|
<DataTrigger Binding="{Binding IsRunning}" Value="True"> |
|
|
|
<Setter Property="Tag" Value="停止"/> |
|
|
|
<Setter Property="Content"> |
|
|
|
<Setter.Value> |
|
|
|
<StackPanel Orientation="Horizontal" Margin="8 0"> |
|
|
|
<icon:PackIconModern Kind="ControlStop" VerticalAlignment="Center" Foreground="#B60F0F" Width="8"/> |
|
|
|
<TextBlock Text="停止" Margin="4 0" VerticalAlignment="Center"/> |
|
|
|
</StackPanel> |
|
|
|
</Setter.Value> |
|
|
|
</Setter> |
|
|
|
</DataTrigger> |
|
|
|
</Style.Triggers> |
|
|
|
</Style> |
|
|
|
</Button.Style> |
|
|
|
</Button> |
|
|
|
|
|
|
|
<Button x:Name="SaveBtn" Margin="16 0 0 0" Padding="0" Click="SaveBtn_Click"> |
|
|
|
<StackPanel Orientation="Horizontal" Margin="8 0"> |
|
|
|
<icon:PackIconModern Kind="Save" VerticalAlignment="Center" Width="12"/> |
|
|
|
<TextBlock Text="保存" Margin="4 0" VerticalAlignment="Center"/> |
|
|
|
</StackPanel> |
|
|
|
</Button> |
|
|
|
|
|
|
|
<Button x:Name="LoadBtn" Margin="4 0 0 0" Padding="0" Click="LoadBtn_Click"> |
|
|
|
<StackPanel Orientation="Horizontal" Margin="8 0"> |
|
|
|
<icon:PackIconModern Kind="DiskDownload" VerticalAlignment="Center" Width="14"/> |
|
|
|
<TextBlock Text="加载" Margin="4 0" VerticalAlignment="Center"/> |
|
|
|
</StackPanel> |
|
|
|
</Button> |
|
|
|
|
|
|
|
<Button x:Name="LoadBtnValue" Margin="4 0 0 0" Padding="0" Click="LoadBtnValue_Click"> |
|
|
|
<StackPanel Orientation="Horizontal" Margin="8 0"> |
|
|
|
<icon:PackIconModern Kind="DiskDownload" VerticalAlignment="Center" Width="14"/> |
|
|
|
<TextBlock Text="变量管理" Margin="4 0" VerticalAlignment="Center"/> |
|
|
|
</StackPanel> |
|
|
|
</Button> |
|
|
|
|
|
|
|
<Button x:Name="MNBtn" Margin="4 0 0 0" Padding="0" Click="MNBtn_Click"> |
|
|
|
<StackPanel Orientation="Horizontal" Margin="8 0"> |
|
|
|
<icon:PackIconModern Kind="MessageSend" VerticalAlignment="Center" Width="14"/> |
|
|
|
<TextBlock Text="模拟消息" Margin="4 0" VerticalAlignment="Center"/> |
|
|
|
</StackPanel> |
|
|
|
</Button> |
|
|
|
|
|
|
|
<ToggleButton x:Name="showCode" Click="showCode_Click" DockPanel.Dock="Right" Margin="4 0 0 0" Padding="4 0"> |
|
|
|
<icon:Material Kind="FileCode"/> |
|
|
|
</ToggleButton> |
|
|
|
|
|
|
|
<Slider DockPanel.Dock="Right" Width="100" Maximum="16" Minimum="1" Margin="4 0 0 0" |
|
|
|
HorizontalContentAlignment="Center" Value="{Binding ElementName=cav,Path=GridPxiel}" ></Slider> |
|
|
|
<TextBlock DockPanel.Dock="Right" Text="对齐:" VerticalAlignment="Center" Margin="16 0 0 0"/> |
|
|
|
|
|
|
|
</DockPanel> |
|
|
|
|
|
|
|
<!--中间画布--> |
|
|
|
<Border BorderThickness="1" BorderBrush="{StaticResource AccentBrush}" Margin="4"> |
|
|
|
<Border.Background> |
|
|
|
<ImageBrush ImageSource="/Images/bj.png" Stretch="UniformToFill"/> |
|
|
|
</Border.Background> |
|
|
|
<Grid> |
|
|
|
<Grid.ColumnDefinitions> |
|
|
|
<ColumnDefinition/> |
|
|
|
<ColumnDefinition Width="auto"/> |
|
|
|
</Grid.ColumnDefinitions> |
|
|
|
|
|
|
|
<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"> |
|
|
|
<ctl:CanvasPanel.Background> |
|
|
|
<VisualBrush TileMode="Tile" Viewport="0,0,20,20" ViewportUnits="Absolute"> |
|
|
|
<VisualBrush.Visual> |
|
|
|
<Rectangle Width="20" Height="20" StrokeDashArray="4,2" StrokeThickness="0.5" Stroke="#CBCBCB"> |
|
|
|
<Rectangle.Style> |
|
|
|
<Style TargetType="{x:Type Rectangle}"> |
|
|
|
<Style.Triggers> |
|
|
|
<DataTrigger Binding="{Binding UseAutoAlignment, RelativeSource={RelativeSource AncestorType={x:Type ctl:CanvasPanel}, Mode=FindAncestor}}" Value="True"> |
|
|
|
<Setter Property="Visibility" Value="Visible"/> |
|
|
|
</DataTrigger> |
|
|
|
<DataTrigger Binding="{Binding UseAutoAlignment, RelativeSource={RelativeSource AncestorType={x:Type ctl:CanvasPanel}, Mode=FindAncestor}}" Value="False"> |
|
|
|
<Setter Property="Visibility" Value="Collapsed"/> |
|
|
|
</DataTrigger> |
|
|
|
</Style.Triggers> |
|
|
|
</Style> |
|
|
|
</Rectangle.Style> |
|
|
|
</Rectangle> |
|
|
|
</VisualBrush.Visual> |
|
|
|
</VisualBrush> |
|
|
|
</ctl:CanvasPanel.Background> |
|
|
|
|
|
|
|
<ctl:CanvasPanel.RenderTransform> |
|
|
|
<TransformGroup> |
|
|
|
<TranslateTransform x:Name="CanvasTranslate"/> |
|
|
|
</TransformGroup> |
|
|
|
</ctl:CanvasPanel.RenderTransform> |
|
|
|
</ctl:CanvasPanel> |
|
|
|
|
|
|
|
<ctl:RunCanvas x:Name="runCanvas" Visibility="{Binding RunCanvasVisibility}" /> |
|
|
|
|
|
|
|
<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}}"/> |
|
|
|
</Grid> |
|
|
|
</Border> |
|
|
|
</DockPanel> |
|
|
|
|
|
|
|
<GridSplitter HorizontalAlignment="Right" Grid.Column="1" VerticalAlignment="Stretch" Width="5" Background="Transparent"/> |
|
|
|
|
|
|
|
<!--右侧属性栏--> |
|
|
|
<Grid Grid.Column="2"> |
|
|
|
<TabControl SelectedIndex="0"> |
|
|
|
<TabItem Header="属性设置"> |
|
|
|
<mypro:PropertyGrid Margin="10" ShowAdvancedOptions="True" ShowDescriptionByTooltip="True" |
|
|
|
FontSize="14" ShowTitle="False" ShowSortOptions="False" ShowSearchBox="False" |
|
|
|
AutoGenerateProperties="False" |
|
|
|
CategoryGroupHeaderTemplate="{DynamicResource Category}" SelectedObject="{Binding SelectedItem,ElementName=cav,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" > |
|
|
|
<mypro:PropertyGrid.PropertyDefinitions> |
|
|
|
<mypro:PropertyDefinition Name="FontSize" ></mypro:PropertyDefinition> |
|
|
|
<mypro:PropertyDefinition DisplayName="名称" Category="基本属性" DisplayOrder="0" Name="Name" Description="设置控件的标识,可以在Js脚本中通过标识操作控件。"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="内容" Category="基本属性" DisplayOrder="1" Name="Content"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="标题" Category="基本属性" DisplayOrder="1" Name="Header" Description="Header"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="文本" Category="基本属性" DisplayOrder="1" Name="Text" Description="Text"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="值" Category="基本属性" DisplayOrder="2" Name="NumberValue" Description="NumberValue"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="数值" Category="基本属性" DisplayOrder="2" Name="CurValue" Description="CurValue"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="状态值" Category="基本属性" DisplayOrder="2" Name="StatusValue" Description="StatusValue"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="勾选状态" Category="基本属性" DisplayOrder="2" Name="IsChecked" Description="IsChecked"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="数值" Category="基本属性" DisplayOrder="2" Name="Value" Description="Value"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="物料重量(g)" Category="基本属性" DisplayOrder="2" Name="KgValue" Description="克数"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="物料描述" Category="基本属性" DisplayOrder="2" Name="WLText" Description="物料描述"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="物料标题" Category="基本属性" DisplayOrder="2" Name="WLTitle" Description="物料标题"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="标题" Category="基本属性" DisplayOrder="2" Name="Title" Description="标题"/> |
|
|
|
|
|
|
|
<mypro:PropertyDefinition DisplayName="最大值" Category="基本属性" DisplayOrder="3" Name="MaxValue" Description="MaxValue"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="最小值" Category="基本属性" DisplayOrder="3" Name="MinValue" Description="MinValue"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="最大值" Category="基本属性" DisplayOrder="3" Name="Maximum" Description="Maximum"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="最小值" Category="基本属性" DisplayOrder="3" Name="Minimum" Description="Minimum"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="间隔" Category="基本属性" DisplayOrder="3" Name="Interval"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="宽度" Category="基本属性" DisplayOrder="3" Name="Width"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="高度" Category="基本属性" DisplayOrder="3" Name="Height"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="勾选状态" Category="基本属性" DisplayOrder="3" Name="BindingIsChecked"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="路径" Category="基本属性" DisplayOrder="3" Name="Source" /> |
|
|
|
<mypro:PropertyDefinition DisplayName="字体大小" Category="基本属性" DisplayOrder="4" Name="FontSize"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="字体" Category="基本属性" DisplayOrder="4" Name="FontFamily"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="字体样式" Category="基本属性" DisplayOrder="4" Name="FontWeight"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="垂直对齐" Category="基本属性" DisplayOrder="4" Name="VerticalContentAlignment"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="水平对齐" Category="基本属性" DisplayOrder="4" Name="HorizontalContentAlignment"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="所属分组" Category="基本属性" DisplayOrder="4" Name="GroupName"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="文本提示" Category="基本属性" DisplayOrder="4" Name="ToolTip"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="左边距" Category="基本属性" DisplayOrder="4" Name="(Canvas.Left)"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="上边距" Category="基本属性" DisplayOrder="4" Name="(Canvas.Top)"/> |
|
|
|
|
|
|
|
|
|
|
|
<mypro:PropertyDefinition DisplayName="数据来源类型" Category="数据绑定模块" DisplayOrder="0" Name="DataSouceType"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="设备名称" Category="数据绑定模块" DisplayOrder="0" Name="DeviceName"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="接口类型" Category="数据绑定模块" DisplayOrder="1" Name="InterfaceMode"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="接口参数" Category="数据绑定模块" DisplayOrder="2" Name="InterfaceParameters"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="连接信息" Category="数据绑定模块" DisplayOrder="3" Name="DataSouceInformation"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="设备解析变量" Category="数据绑定模块" DisplayOrder="4" Name="DeviceValuleName"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="数据源" Category="数据绑定模块" DisplayOrder="5" Name="FDataSouce"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="代码过滤脚本" Category="数据绑定模块" DisplayOrder="6" Name="Code"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="数据结果" Category="数据绑定模块" DisplayOrder="7" Name="GenerateData"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="定时间隔" Category="数据绑定模块" DisplayOrder="8" Name="TimeCount"/> |
|
|
|
|
|
|
|
|
|
|
|
<mypro:PropertyDefinition DisplayName="列表项" Category="集合设置" Name="ItemsString" /> |
|
|
|
<mypro:PropertyDefinition DisplayName="列表项" Category="集合设置" Name="TabItems" /> |
|
|
|
|
|
|
|
<mypro:PropertyDefinition DisplayName="前景色" Category="颜色设置" Name="Foreground"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="背景色" Category="颜色设置" Name="Background"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="边框色" Category="颜色设置" Name="BorderBrush"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="填充" Category="基本属性" DisplayOrder="5" Name="WaveFill"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="边框粗细" Category="基本属性" DisplayOrder="5" Name="WaveThickness"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="边框" Category="基本属性" DisplayOrder="5" Name="WaveStroke"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="填充" Category="基本属性" DisplayOrder="5" Name="Fill"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="边框" Category="基本属性" DisplayOrder="5" Name="Stroke"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="边框粗细" Category="基本属性" DisplayOrder="5" Name="StrokeThickness"/> |
|
|
|
<mypro:PropertyDefinition DisplayName="边框粗细" Category="基本属性" DisplayOrder="5" Name="BorderThickness"/> |
|
|
|
|
|
|
|
<mypro:PropertyDefinition DisplayName="点击事件" Category="事件绑定" DisplayOrder="0" Name="ClickExec" /> |
|
|
|
<mypro:PropertyDefinition DisplayName="值改变事件" Category="事件绑定" DisplayOrder="1" Name="ValueChangedExecute" /> |
|
|
|
<mypro:PropertyDefinition DisplayName="定时触发" Category="事件绑定" DisplayOrder="2" Name="TikcExecute" /> |
|
|
|
<mypro:PropertyDefinition DisplayName="勾选事件" Category="事件绑定" DisplayOrder="3" Name="CheckedExec" /> |
|
|
|
<mypro:PropertyDefinition DisplayName="取消勾选事件" Category="事件绑定" DisplayOrder="4" Name="UnCheckedExec" /> |
|
|
|
<mypro:PropertyDefinition DisplayName="接收消息集" Category="事件绑定" DisplayOrder="5" Name="EventReceiveNameList" /> |
|
|
|
<mypro:PropertyDefinition DisplayName="出料单击事件" Category="事件绑定" DisplayOrder="6" Name="出料单击事件" /> |
|
|
|
<mypro:PropertyDefinition DisplayName="停止出料单击事件" Category="事件绑定" DisplayOrder="7" Name="停止出料单击事件" /> |
|
|
|
|
|
|
|
|
|
|
|
</mypro:PropertyGrid.PropertyDefinitions> |
|
|
|
|
|
|
|
<mypro:PropertyGrid.EditorDefinitions> |
|
|
|
<mypro:EditorTemplateDefinition TargetProperties="Foreground,Background,BorderBrush,WaveFill,WaveStroke,Fill,Stroke"> |
|
|
|
<mypro:EditorTemplateDefinition.EditingTemplate> |
|
|
|
<DataTemplate> |
|
|
|
<!--此处可自由发挥--> |
|
|
|
<Grid> |
|
|
|
<mypro:ColorPicker SelectedColor="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, Converter={x:Static s:ColorToStringConverter.Instance}}" /> |
|
|
|
</Grid> |
|
|
|
</DataTemplate> |
|
|
|
</mypro:EditorTemplateDefinition.EditingTemplate> |
|
|
|
</mypro:EditorTemplateDefinition> |
|
|
|
|
|
|
|
<mypro:EditorTemplateDefinition TargetProperties="Source"> |
|
|
|
<mypro:EditorTemplateDefinition.EditingTemplate> |
|
|
|
<DataTemplate> |
|
|
|
<Grid> |
|
|
|
<Grid.ColumnDefinitions> |
|
|
|
<ColumnDefinition Width="*"/> |
|
|
|
<ColumnDefinition Width="35"/> |
|
|
|
</Grid.ColumnDefinitions> |
|
|
|
<ToggleButton Grid.Column="1" Height="30" Content="..." Width="26" Margin="5,0,0,0" HorizontalAlignment="Left" Click="LJToggleButton_Click"></ToggleButton> |
|
|
|
<TextBox Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/> |
|
|
|
</Grid> |
|
|
|
</DataTemplate> |
|
|
|
</mypro:EditorTemplateDefinition.EditingTemplate> |
|
|
|
</mypro:EditorTemplateDefinition> |
|
|
|
|
|
|
|
<!--代码绑定模块--> |
|
|
|
<mypro:EditorTemplateDefinition TargetProperties="ClickExec,ValueChangedExecute,TikcExecute,CheckedExec,UnCheckedExec" > |
|
|
|
<mypro:EditorTemplateDefinition.EditingTemplate> |
|
|
|
<DataTemplate> |
|
|
|
<Grid> |
|
|
|
<Grid.ColumnDefinitions> |
|
|
|
<ColumnDefinition Width="*"/> |
|
|
|
<ColumnDefinition Width="35"/> |
|
|
|
</Grid.ColumnDefinitions> |
|
|
|
<ToggleButton Grid.Column="1" Height="30" Content="编辑" Width="26" Margin="5,0,0,0" HorizontalAlignment="Left" Click="ToggleButton_Click"></ToggleButton> |
|
|
|
<TextBox Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/> |
|
|
|
</Grid> |
|
|
|
</DataTemplate> |
|
|
|
</mypro:EditorTemplateDefinition.EditingTemplate> |
|
|
|
</mypro:EditorTemplateDefinition> |
|
|
|
|
|
|
|
<mypro:EditorTemplateDefinition TargetProperties="Code" > |
|
|
|
<mypro:EditorTemplateDefinition.EditingTemplate> |
|
|
|
<DataTemplate> |
|
|
|
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto"> |
|
|
|
<TextBox Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" AcceptsReturn="True" TextWrapping="Wrap"></TextBox> |
|
|
|
</ScrollViewer> |
|
|
|
</DataTemplate> |
|
|
|
</mypro:EditorTemplateDefinition.EditingTemplate> |
|
|
|
</mypro:EditorTemplateDefinition> |
|
|
|
|
|
|
|
<mypro:EditorTemplateDefinition TargetProperties="DeviceValuleName" > |
|
|
|
<mypro:EditorTemplateDefinition.EditingTemplate> |
|
|
|
<DataTemplate> |
|
|
|
<ComboBox Grid.Column="1" Height="25" Width="{Binding Width, ElementName=com}" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" |
|
|
|
ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window},Path=DataContext.DevValueList}" |
|
|
|
></ComboBox> |
|
|
|
</DataTemplate> |
|
|
|
</mypro:EditorTemplateDefinition.EditingTemplate> |
|
|
|
</mypro:EditorTemplateDefinition> |
|
|
|
|
|
|
|
<mypro:EditorTemplateDefinition TargetProperties="DeviceName" > |
|
|
|
<mypro:EditorTemplateDefinition.EditingTemplate> |
|
|
|
<DataTemplate> |
|
|
|
<ComboBox Grid.Column="1" Height="25" Width="{Binding Width, ElementName=com}" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" |
|
|
|
ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window},Path=DataContext.DevNameList}" |
|
|
|
></ComboBox> |
|
|
|
</DataTemplate> |
|
|
|
</mypro:EditorTemplateDefinition.EditingTemplate> |
|
|
|
</mypro:EditorTemplateDefinition> |
|
|
|
|
|
|
|
<mypro:EditorTemplateDefinition TargetProperties="Text,Content,Title,Value,BindingIsChecked,Header,KgValue,WLText,WLTitle" > |
|
|
|
<mypro:EditorTemplateDefinition.EditingTemplate> |
|
|
|
<DataTemplate> |
|
|
|
<!--此处可自由发挥--> |
|
|
|
<Grid> |
|
|
|
<Grid.RowDefinitions> |
|
|
|
<RowDefinition/> |
|
|
|
<RowDefinition/> |
|
|
|
</Grid.RowDefinitions> |
|
|
|
<Grid Margin="0,5,0,5"> |
|
|
|
<Grid.ColumnDefinitions> |
|
|
|
<ColumnDefinition Width="40" /> |
|
|
|
<ColumnDefinition Width="*" x:Name="key"/> |
|
|
|
<ColumnDefinition Width="*" x:Name="Text"/> |
|
|
|
</Grid.ColumnDefinitions> |
|
|
|
<TextBlock>绑定:</TextBlock> |
|
|
|
<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" |
|
|
|
ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window},Path=DataContext.DevNameList}"> |
|
|
|
</ComboBox> |
|
|
|
<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" |
|
|
|
ItemsSource="{Binding RelativeSource={RelativeSource Mode=FindAncestor,AncestorType=Window},Path=DataContext.DevValueList}"/> |
|
|
|
</Grid> |
|
|
|
<TextBox Grid.Row="2" x:Name="wenben" Padding="5" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap"></TextBox> |
|
|
|
|
|
|
|
</Grid> |
|
|
|
</DataTemplate> |
|
|
|
</mypro:EditorTemplateDefinition.EditingTemplate> |
|
|
|
</mypro:EditorTemplateDefinition> |
|
|
|
</mypro:PropertyGrid.EditorDefinitions> |
|
|
|
</mypro:PropertyGrid> |
|
|
|
</TabItem> |
|
|
|
<!--<TabItem Header="所有属性"> |
|
|
|
<mypro:PropertyGrid x:Name="dsdsdsd" |
|
|
|
Margin="10" ShowAdvancedOptions="True" ShowDescriptionByTooltip="True" |
|
|
|
FontSize="14" ShowTitle="False" ShowSortOptions="False" ShowSearchBox="False" |
|
|
|
CategoryGroupHeaderTemplate="{DynamicResource Category}" SelectedObject="{Binding SelectedItem,ElementName=cav,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" /> |
|
|
|
|
|
|
|
</TabItem>--> |
|
|
|
</TabControl> |
|
|
|
</Grid> |
|
|
|
</Grid> |
|
|
|
</Border> |
|
|
|
</Window> |