|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531 |
- <UserControl x:Class="BeDesignerSCADA.Controls.CanvasPanelNew"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:BeDesignerSCADA.Controls"
- xmlns:s="clr-namespace:BeDesignerSCADA.Converters"
- xmlns:icon="http://metro.mahapps.com/winfx/xaml/iconpacks"
- xmlns:avae="http://icsharpcode.net/sharpdevelop/avalonedit"
- xmlns:Compiler="clr-namespace:BPASmartClient.Compiler;assembly=BPASmartClient.Compiler"
- xmlns:ctl="clr-namespace:BeDesignerSCADA.Controls"
- xmlns:mypro="http://schemas.xceed.com/wpf/xaml/toolkit"
- mc:Ignorable="d"
- d:DesignHeight="900" d:DesignWidth="1400">
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="/可视化配置工具;component/Themes/Styles.xaml"></ResourceDictionary>
- <ResourceDictionary Source="/BPASmartClient.SCADAControl;component/Themes/Generic.xaml" />
- </ResourceDictionary.MergedDictionaries>
- </ResourceDictionary>
- </UserControl.Resources>
- <Grid x:Name="grid">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="245"/>
- <ColumnDefinition/>
- <ColumnDefinition Width="320"/>
- </Grid.ColumnDefinitions>
-
- <!--左侧选择区域-->
- <TabControl x:Name="LeftSelectTab" SelectedIndex="0" SelectionChanged="TabControl_SelectionChanged">
- <TabItem Header="页面编辑">
- <Border BorderThickness="1" BorderBrush="#FFA9A9A9" Background="Transparent" >
- <Grid >
- <ListBox x:Name="PageList"
- ItemContainerStyle="{StaticResource ItemContainerStyle1}" Grid.Row="0" Margin="0,5,0,0"
- HorizontalAlignment="Center"
- SelectedItem="{Binding MenuModel.SelectPageModels,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
- ItemsSource="{Binding MenuModel.pageModels,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
- Background="Transparent"
- ScrollViewer.VerticalScrollBarVisibility="Auto"
- ItemTemplate="{DynamicResource PageBoxStyle}"
- SelectionChanged="PageList_SelectionChanged"
- FontSize="14" BorderThickness="0" >
- <ListBox.ContextMenu>
- <ContextMenu>
- <MenuItem Header="增加一页" Command="{Binding AddPageCommand}" CommandParameter="{Binding MenuModel.SelectPageModels}">
- <MenuItem.Icon>
- <icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Add" />
- </MenuItem.Icon>
- </MenuItem>
- <MenuItem Header="设置首页" Command="{Binding SetHomePageCommand}">
- <MenuItem.Icon>
- <icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Home" />
- </MenuItem.Icon>
- </MenuItem>
- <MenuItem Header="向上移动" Command="{Binding SetTopPageCommand}">
- <MenuItem.Icon>
- <icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Upload" />
- </MenuItem.Icon>
- </MenuItem>
- <MenuItem Header="向下移动" Command="{Binding SetBottomPageCommand}">
- <MenuItem.Icon>
- <icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Download" />
- </MenuItem.Icon>
- </MenuItem>
- <MenuItem Header="删除该页" Command="{Binding DeletePageCommand}" CommandParameter="{Binding MenuModel.SelectPageModels}">
- <MenuItem.Icon>
- <icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Delete" />
- </MenuItem.Icon>
- </MenuItem>
- <MenuItem Header="清空该页" Command="{Binding ClearPageCommand}" CommandParameter="{Binding MenuModel.SelectPageModels}">
- <MenuItem.Icon>
- <icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Clean" />
- </MenuItem.Icon>
- </MenuItem>
- <MenuItem Header="(加载)页面" Command="{Binding LoadAllPageCommand}">
- <MenuItem.Icon>
- <icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="DiskDownload" />
- </MenuItem.Icon>
- </MenuItem>
- <MenuItem Header="(保存)页面" Command="{Binding SaveAllPageCommand}">
- <MenuItem.Icon>
- <icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Save" />
- </MenuItem.Icon>
- </MenuItem>
- <MenuItem Header="(另存)页面" Command="{Binding LWSaveAllPageCommand}">
- <MenuItem.Icon>
- <icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="Save" />
- </MenuItem.Icon>
- </MenuItem>
- <MenuItem Header="变量管理器" Command="{Binding LoadValuesCommand}">
- <MenuItem.Icon>
- <icon:PackIconModern Width="10" HorizontalAlignment="Center" Kind="DiskDownload" />
- </MenuItem.Icon>
- </MenuItem>
- </ContextMenu>
- </ListBox.ContextMenu>
- </ListBox>
- </Grid>
- </Border>
- </TabItem>
-
- <TabItem Header="组件列表">
- <Border BorderThickness="1" BorderBrush="#FFA9A9A9" Background="Transparent">
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="35"/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <TextBox Margin="5" TextChanged="TextBox_TextChanged" FontSize="16"></TextBox>
- <ListBox x:Name="CtlList" Grid.Row="2" Background="Transparent" ScrollViewer.VerticalScrollBarVisibility="Auto"
- ItemTemplate="{DynamicResource ToolBoxStyle}" FontSize="14" BorderThickness="0"
- PreviewMouseMove="CtlList_PreviewMouseMove"/>
- </Grid>
- </Border>
- </TabItem>
-
- <TabItem Header="菜单布局">
- <Border BorderThickness="1" BorderBrush="#FFA9A9A9" Background="Transparent">
- <mypro:PropertyGrid Margin="10" ShowAdvancedOptions="True" ShowDescriptionByTooltip="True"
- FontSize="14" ShowTitle="False" ShowSortOptions="False" ShowSearchBox="False"
- AutoGenerateProperties="False"
- CategoryGroupHeaderTemplate="{DynamicResource Category}" SelectedObject="{Binding DataContext.MenuModel,RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" >
- <mypro:PropertyGrid.PropertyDefinitions>
- <mypro:PropertyDefinition Name="FontSize" ></mypro:PropertyDefinition>
- <mypro:PropertyDefinition DisplayName="是否显示菜单" Category="菜单属性" DisplayOrder="1" Name="IsVisibility" Description="是否显示菜单"/>
- <mypro:PropertyDefinition DisplayName="菜单显示方向" Category="菜单属性" DisplayOrder="2" Name="Alignment" Description="菜单显示方向"/>
- <mypro:PropertyDefinition DisplayName="程序标题" Category="菜单属性" DisplayOrder="2" Name="Name" Description="程序集标题"/>
- </mypro:PropertyGrid.PropertyDefinitions>
- </mypro:PropertyGrid>
- </Border>
- </TabItem>
- </TabControl>
-
- <!--中间控制区域-->
- <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="Run1Btn" Margin="4 0 0 0" Padding="0" Click="MNRunBtn_Click">
- <StackPanel Orientation="Horizontal" Margin="8 0">
- <icon:PackIconModern Kind="ControlPlay" VerticalAlignment="Center" Foreground="#28B60F" Width="8"/>
- <TextBlock Text="运行程序" Margin="4 0" VerticalAlignment="Center"/>
- </StackPanel>
- </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="SavePage" Margin="4 0 0 0" Padding="0" Click="SavePage_Click">
- <StackPanel Orientation="Horizontal" Margin="8 0">
- <icon:PackIconModern Kind="Save" VerticalAlignment="Center" Width="12"/>
- <TextBlock Text="同步" Margin="4 0" VerticalAlignment="Center"/>
- </StackPanel>
- </Button>
-
- <TextBlock HorizontalAlignment="Center" Margin="4 0 0 0" MaxWidth="200" TextWrapping="Wrap" Height="25" FontSize="10" VerticalAlignment="Bottom" Foreground="Red">温馨提示:布局完成点击“同步”按钮,保存布局到菜单页面,菜单页面“右键”可导出整体布局!</TextBlock>
-
- <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" x:Name="slikl" Width="100" Maximum="50" Minimum="4" Margin="4 0 0 0"
- HorizontalContentAlignment="Center" Value="{Binding ElementName=cav,Path=GridPxiel}" />
- <TextBlock DockPanel.Dock="Right" Text="对齐:" VerticalAlignment="Center" Margin="16 0 0 0"/>
-
- <CheckBox x:Name="IsYSSX" Content="原生属性" DockPanel.Dock="Right" VerticalAlignment="Center" Margin="0 0 0 0"></CheckBox>
-
- </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>
-
- <ScrollViewer VerticalScrollBarVisibility="Visible" HorizontalScrollBarVisibility="Visible">
- <Grid>
- <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">
- </Compiler:CanvasPanel>
- <ctl:RunCanvas x:Name="runCanvas" Visibility="{Binding DataContext.RunCanvasVisibility, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" />
- </Grid>
- </ScrollViewer>
-
- <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}}"/>
-
- <TextBlock HorizontalAlignment="Right" VerticalAlignment="Bottom" Margin="0,0,20,20" FontSize="16" Foreground="Red">分辨率:1920×1080</TextBlock>
- </Grid>
- </Border>
- </DockPanel>
-
- <GridSplitter HorizontalAlignment="Right" Grid.Column="1" VerticalAlignment="Stretch" Width="5" Background="Transparent"/>
-
- <!--右侧属性栏-->
- <Grid Grid.Column="2">
- <TabControl x:Name="ReditSeleceTab" 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=PageList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" >
- <mypro:PropertyGrid.PropertyDefinitions>
- <mypro:PropertyDefinition Name="FontSize" ></mypro:PropertyDefinition>
- <mypro:PropertyDefinition DisplayName="页面名称" Category="页面属性" DisplayOrder="1" Name="Name" Description="页面名称"/>
- <mypro:PropertyDefinition DisplayName="菜单名称" Category="页面属性" DisplayOrder="2" Name="MenuName" Description="菜单名称"/>
- </mypro:PropertyGrid.PropertyDefinitions>
- </mypro:PropertyGrid>
- </TabItem>
- <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="2" Name="Direction" Description="Direction"/>
- <mypro:PropertyDefinition DisplayName="Tag" Category="基本属性" DisplayOrder="2" Name="Tag" Description="Tag"/>
- <mypro:PropertyDefinition DisplayName="启动路径" Category="基本属性" DisplayOrder="2" Name="StartPath" Description="StartPath"/>
- <mypro:PropertyDefinition DisplayName="消息类型" Category="基本属性" DisplayOrder="2" Name="MessageLX" Description="MessageLX"/>
-
- <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="ImageStartPath" />
- <mypro:PropertyDefinition DisplayName="FontSize" 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="FontStyle"/>
- <mypro:PropertyDefinition DisplayName="下划线" Category="基本属性" DisplayOrder="4" Name="TextDecorations"/>
-
- <mypro:PropertyDefinition DisplayName="文字环绕样式" Category="基本属性" DisplayOrder="4" Name="TextWrapping"/>
- <mypro:PropertyDefinition DisplayName="是否使能" Category="基本属性" DisplayOrder="5" Name="IsEnabled"/>
- <mypro:PropertyDefinition DisplayName="是否显示" Category="基本属性" DisplayOrder="5" Name="Visibility"/>
- <mypro:PropertyDefinition DisplayName="回车换行" Category="基本属性" DisplayOrder="5" Name="AcceptsReturn"/>
- <mypro:PropertyDefinition DisplayName="鼠标样式" Category="基本属性" DisplayOrder="5" Name="Cursor"/>
- <mypro:PropertyDefinition DisplayName="键盘触发顺序" Category="基本属性" DisplayOrder="5" Name="TabIndex"/>
- <mypro:PropertyDefinition DisplayName="控件透明度" Category="基本属性" DisplayOrder="5" Name="Opacity"/>
- <mypro:PropertyDefinition DisplayName="垂直滚动条" Category="基本属性" DisplayOrder="6" Name="VerticalScrollBarVisibility"/>
- <mypro:PropertyDefinition DisplayName="水平滚动条" Category="基本属性" DisplayOrder="6" Name="HorizontalScrollBarVisibility"/>
- <mypro:PropertyDefinition DisplayName="是否ESC触发" Category="基本属性" DisplayOrder="7" Name="IsCancel"/>
- <mypro:PropertyDefinition DisplayName="是否Enter触发" Category="基本属性" DisplayOrder="7" Name="IsDefault"/>
-
- <mypro:PropertyDefinition DisplayName="垂直对齐" Category="基本属性" DisplayOrder="8" Name="VerticalContentAlignment"/>
- <mypro:PropertyDefinition DisplayName="水平对齐" Category="基本属性" DisplayOrder="8" Name="HorizontalContentAlignment"/>
- <mypro:PropertyDefinition DisplayName="所属分组" Category="基本属性" DisplayOrder="9" Name="GroupName"/>
- <mypro:PropertyDefinition DisplayName="文本提示" Category="基本属性" DisplayOrder="9" Name="ToolTip"/>
- <mypro:PropertyDefinition DisplayName="左边距" Category="基本属性" DisplayOrder="9" Name="(Canvas.Left)"/>
- <mypro:PropertyDefinition DisplayName="上边距" Category="基本属性" DisplayOrder="9" Name="(Canvas.Top)"/>
- <mypro:PropertyDefinition DisplayName="启动测试" Category="基本属性" DisplayOrder="9" Name="TestData"/>
- <mypro:PropertyDefinition DisplayName="气缸左执行" Category="基本属性" DisplayOrder="10" Name="LeftTogIsChecked"/>
- <mypro:PropertyDefinition DisplayName="气缸右执行" Category="基本属性" DisplayOrder="10" Name="RightTogIsChecked"/>
- <mypro:PropertyDefinition DisplayName="背景透明" Category="基本属性" DisplayOrder="10" Name="IsCheckedColor"/>
- <mypro:PropertyDefinition DisplayName="边框宽度" Category="基本属性" DisplayOrder="10" Name="BKThickness"/>
- <mypro:PropertyDefinition DisplayName="虚线绘制" Category="基本属性" DisplayOrder="10" Name="BKStrokeDashArray"/>
- <mypro:PropertyDefinition DisplayName="边框粗细" Category="基本属性" DisplayOrder="11" Name="WaveThickness"/>
- <mypro:PropertyDefinition DisplayName="边框粗细" Category="基本属性" DisplayOrder="11" Name="StrokeThickness"/>
- <mypro:PropertyDefinition DisplayName="边框粗细" Category="基本属性" DisplayOrder="11" Name="BorderThickness"/>
- <mypro:PropertyDefinition DisplayName="布局方向" Category="基本属性" DisplayOrder="11" Name="Orientation"/>
-
-
- <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="4" Name="IsRun"/>
- <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="ChildTemplateXml" />
-
- <mypro:PropertyDefinition DisplayName="前景色" Category="颜色设置" Name="Foreground"/>
- <mypro:PropertyDefinition DisplayName="背景色" Category="颜色设置" Name="Background"/>
- <mypro:PropertyDefinition DisplayName="填充颜色" Category="颜色设置" Name="BJColor"/>
- <mypro:PropertyDefinition DisplayName="选中色" Category="颜色设置" Name="DKColor"/>
- <mypro:PropertyDefinition DisplayName="边框色" Category="颜色设置" Name="BorderBrush"/>
- <mypro:PropertyDefinition DisplayName="填充" Category="颜色设置" DisplayOrder="5" Name="WaveFill"/>
- <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="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="ChuLiaoExecute" />
- <mypro:PropertyDefinition DisplayName="停止出料单击事件" Category="事件绑定" DisplayOrder="7" Name="StopChuLiaoExecute" />
- </mypro:PropertyGrid.PropertyDefinitions>
-
- <mypro:PropertyGrid.EditorDefinitions>
- <mypro:EditorTemplateDefinition TargetProperties="Opacity">
- <mypro:EditorTemplateDefinition.EditingTemplate>
- <DataTemplate>
- <Slider Maximum="1" Minimum="0" Value="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" ></Slider>
- </DataTemplate>
- </mypro:EditorTemplateDefinition.EditingTemplate>
- </mypro:EditorTemplateDefinition>
-
- <mypro:EditorTemplateDefinition TargetProperties="Foreground,Background,BorderBrush,WaveFill,WaveStroke,Fill,Stroke,BJColor,DKColor">
- <mypro:EditorTemplateDefinition.EditingTemplate>
- <DataTemplate>
- <mypro:ColorPicker SelectedColor="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged, Converter={x:Static s:ColorToStringConverter.Instance}}" />
- </DataTemplate>
- </mypro:EditorTemplateDefinition.EditingTemplate>
- </mypro:EditorTemplateDefinition>
-
- <mypro:EditorTemplateDefinition TargetProperties="ImageStartPath">
- <mypro:EditorTemplateDefinition.EditingTemplate>
- <DataTemplate>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="35"/>
- </Grid.ColumnDefinitions>
- <ToggleButton Grid.Column="1" Height="20" 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="StartPath">
- <mypro:EditorTemplateDefinition.EditingTemplate>
- <DataTemplate>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="35"/>
- </Grid.ColumnDefinitions>
- <ToggleButton Grid.Column="1" Height="20" Content="选择" Width="26" Margin="5,0,0,0" HorizontalAlignment="Left" Click="XZToggleButton_Click"></ToggleButton>
- <TextBox Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center"/>
- </Grid>
- </DataTemplate>
- </mypro:EditorTemplateDefinition.EditingTemplate>
- </mypro:EditorTemplateDefinition>
-
- <!--子控件模板编辑-->
- <mypro:EditorTemplateDefinition TargetProperties="ChildTemplateXml">
- <mypro:EditorTemplateDefinition.EditingTemplate>
- <DataTemplate>
- <Grid>
- <ToggleButton Grid.Column="1" Height="30" Content=" 设置控件模板 " Margin="5,0,0,0" Click="ChildToggleButton_Click"></ToggleButton>
- <TextBox Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" Visibility="Collapsed"/>
- </Grid>
- </DataTemplate>
- </mypro:EditorTemplateDefinition.EditingTemplate>
- </mypro:EditorTemplateDefinition>
-
- <!--代码绑定模块-->
- <mypro:EditorTemplateDefinition TargetProperties="ClickStr,ClickExec,ValueChangedExecute,TikcExecute,CheckedExec,UnCheckedExec,ChuLiaoExecute,StopChuLiaoExecute" >
- <mypro:EditorTemplateDefinition.EditingTemplate>
- <DataTemplate>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="40"/>
- </Grid.ColumnDefinitions>
- <ToggleButton Grid.Column="1" Height="20" Content="编辑" Width="30" Margin="5,0,5,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="IsRun,IsChecked" >
- <mypro:EditorTemplateDefinition.EditingTemplate>
- <DataTemplate>
- <StackPanel Grid.Column="1" Orientation="Horizontal">
- <CheckBox Margin="10,0,0,0" VerticalAlignment="Center" IsChecked="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"></CheckBox>
- <ToggleButton Grid.Column="1" Height="20" Content="绑定" Width="30" Margin="20,0,0,0" HorizontalAlignment="Left" Click="BingToggleButton_Click"></ToggleButton>
- <ToggleButton Height="20" Content="解绑" Width="30" Margin="5,0,0,0" HorizontalAlignment="Right" Click="ClearBingToggleButton_Click"></ToggleButton>
- </StackPanel>
- </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=UserControl},Path=DataContext.DevNameList}"
- ></ComboBox>
- </DataTemplate>
- </mypro:EditorTemplateDefinition.EditingTemplate>
- </mypro:EditorTemplateDefinition>
-
- <mypro:EditorTemplateDefinition TargetProperties="Text,Title,Value,BindingIsChecked,Header,KgValue,WLText,WLTitle,DataSouceInformation,Direction,LeftTogIsChecked,RightTogIsChecked" >
- <mypro:EditorTemplateDefinition.EditingTemplate>
- <DataTemplate>
- <!--此处可自由发挥-->
- <Grid >
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="40"/>
- </Grid.ColumnDefinitions>
- <TextBox Grid.Row="2" x:Name="wenben" Padding="5" Text="{Binding Value,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" TextWrapping="Wrap"></TextBox>
- <StackPanel Grid.Column="1">
- <ToggleButton Grid.Column="1" Height="20" Content="绑定" Width="30" Margin="5,0,5,0" HorizontalAlignment="Left" Click="BingToggleButton_Click"></ToggleButton>
- <ToggleButton Height="20" Content="解绑" Width="30" Margin="5,2,5,0" HorizontalAlignment="Right" Click="ClearBingToggleButton_Click"></ToggleButton>
- </StackPanel>
- </Grid>
- </DataTemplate>
- </mypro:EditorTemplateDefinition.EditingTemplate>
- </mypro:EditorTemplateDefinition>
- </mypro:PropertyGrid.EditorDefinitions>
- </mypro:PropertyGrid>
- </TabItem>
- <TabItem Header="原生属性" Visibility="{Binding ElementName=IsYSSX, Path=IsChecked, Converter={x:Static s:BoolToVisibilityConverter.Instance}}">
- <mypro:PropertyGrid 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>
- </UserControl>
|