| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602 |
- <UserControl x:Class="YSAI.Tool.Wpf.views.UaClient"
- 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:YSAI.Tool.Wpf.views"
- xmlns:NodeStructuralBody="clr-namespace:YSAI.Tool.Wpf.data"
-
- xmlns:c="clr-namespace:YSAI.Tool.Wpf.controllers"
- xmlns:txt="clr-namespace:YSAI.Core.Wpf.controls.textbox;assembly=YSAI.Core.Wpf"
- xmlns:btn="clr-namespace:YSAI.Core.Wpf.controls.button;assembly=YSAI.Core.Wpf"
- xmlns:pt="http://propertytools.org/wpf"
- xmlns:helpers="clr-namespace:YSAI.Core.Wpf.style;assembly=YSAI.Core.Wpf"
- xmlns:cs="clr-namespace:YSAI.Core.Wpf.converters;assembly=YSAI.Core.Wpf"
- xmlns:i="http://schemas.microsoft.com/xaml/behaviors"
- xmlns:mvvm="clr-namespace:YSAI.Core.Wpf.mvvm;assembly=YSAI.Core.Wpf"
- Background="{DynamicResource ContentBackgroundPicture}">
- <UserControl.DataContext>
- <c:UaClientController />
- </UserControl.DataContext>
- <!--资源加载-->
- <UserControl.Resources>
- <ResourceDictionary>
- <Style TargetType="ToolTip">
- <Setter Property="Foreground" Value="{DynamicResource Font.Content.Foreground}"/>
- <Setter Property="BorderBrush" Value="{DynamicResource Control.Border.Color}"/>
- </Style>
- <cs:CheckConverter x:Key="CheckConverter" />
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_ComboBox.xaml" />
- <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_Button.xaml" />
- <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_DataGrid.xaml" />
- <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_Border.xaml" />
- <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_TbaControl.xaml" />
- <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_ScrollViewer.xaml" />
- <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_GroupBox.xaml" />
- <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_TextBox.xaml" />
- <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_CheckBox.xaml" />
- <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_RadioButton.xaml" />
- <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_DatePicker.xaml" />
- <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_ContextMenu.xaml" />
- <ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_TreeView.xaml" />
- </ResourceDictionary.MergedDictionaries>
- </ResourceDictionary>
- </UserControl.Resources>
- <Border Background="#F0F2F0" Width="auto" Height="auto" CornerRadius="{DynamicResource WindowCornerRadius}" Margin="50">
- <GroupBox Style="{StaticResource GroupBoxTab}" Margin="0" >
- <GroupBox.Header>
- <StackPanel Orientation="Horizontal">
- <Grid Background="Transparent">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Image Grid.Column="0" Margin="10,0,8,0" Source="{DynamicResource Tool}" Width="14" />
- <TextBlock Text="{Binding ToolTitle}" FontSize="13" Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
- </Grid>
- </StackPanel>
- </GroupBox.Header>
- <!--基础数据与功能区域-->
- <Grid >
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto"/>
- <ColumnDefinition Width="*"/>
- <ColumnDefinition Width="auto"/>
- </Grid.ColumnDefinitions>
- <ToggleButton Grid.Column="0" Grid.ColumnSpan="3" VerticalAlignment="Top" HorizontalAlignment="Right" Margin="0,-28,3,0" ToolTip="节点信息浏览[隐藏/显示]" Panel.ZIndex="3" IsChecked="{Binding NodeBrowseIsChecked}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Unchecked">
- <mvvm:EventCommand Command="{Binding ToggleButton_Unchecked}" />
- </i:EventTrigger>
- <i:EventTrigger EventName="Checked">
- <mvvm:EventCommand Command="{Binding ToggleButton_Checked}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <ToggleButton.Template>
- <ControlTemplate TargetType="{x:Type ToggleButton}">
- <Image x:Name="image" Source="{DynamicResource ZommOff}" Stretch="Fill" Width="15" Height="15" />
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="True">
- <Setter Property="Source" TargetName="image" Value="{DynamicResource ZommOn}"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </ToggleButton.Template>
- <ToggleButton.Triggers>
- <EventTrigger RoutedEvent="ToggleButton.Unchecked">
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Storyboard.TargetName="nodeBrowse" Storyboard.TargetProperty="MinWidth" From="1150" To="0" Duration="0:0:0.7"/>
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- <EventTrigger RoutedEvent="ToggleButton.Checked">
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Storyboard.TargetName="nodeBrowse" Storyboard.TargetProperty="MinWidth" From="0" To="1150" Duration="0:0:0.7"/>
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- </ToggleButton.Triggers>
- </ToggleButton>
-
- <!--基础数据-->
- <Grid Grid.Column="0" x:Name="propertyGrid" Margin="0,0,3,0" Width="550">
- <Grid.RowDefinitions>
- <RowDefinition Height="auto"/>
- <RowDefinition Height="auto"/>
- </Grid.RowDefinitions>
- <!--导入导出-->
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,0,-30" Panel.ZIndex="2">
- <btn:ButtonControl
- Width="80"
- Command="{Binding IncBasics}"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- IsMouseOverBorderBrushColor="{DynamicResource Control.Border.One.Color}"
- BorderBrush="{DynamicResource Control.Border.Color}"
- IsPressedBorderBrushColor="{DynamicResource Control.Border.Two.Color}"
- Foreground="{DynamicResource Font.Content.Foreground}"
- Icon="{DynamicResource Inc}"
- Content="导入"
- BorderThickness="1,0,0,0" />
- <btn:ButtonControl
- Width="80"
- Command="{Binding ExpBasics}"
- HorizontalAlignment="Center"
- VerticalAlignment="Center"
- IsMouseOverBorderBrushColor="{DynamicResource Control.Border.One.Color}"
- BorderBrush="{DynamicResource Control.Border.Color}"
- IsPressedBorderBrushColor="{DynamicResource Control.Border.Two.Color}"
- Foreground="{DynamicResource Font.Content.Foreground}"
- Icon="{DynamicResource Exp}"
- Content="导出"
- BorderThickness="1,0,0,0" />
- </StackPanel>
- <!--属性表格-->
- <Grid Grid.Row="1" Panel.ZIndex="1">
- <Grid.Resources>
- <ResourceDictionary>
- <Style TargetType="{x:Type Label}" >
- <Setter Property="FontSize" Value="13"/>
- <Setter Property="Foreground" Value="{DynamicResource Font.Content.Foreground}"/>
- <Setter Property="HorizontalAlignment" Value="Left"/>
- </Style>
- <Style TargetType="{x:Type ComboBox}" BasedOn="{StaticResource DefaultComboBox}" >
- <Setter Property="Height" Value="25"/>
- <Setter Property="Background" Value="White"/>
- <Setter Property="VerticalAlignment" Value="Center"/>
- <Setter Property="helpers:Style_ComboBox.CornerRadius" Value="{DynamicResource WindowCornerRadius}"/>
- </Style>
- <Style TargetType="{x:Type pt:TextBoxEx}" BasedOn="{StaticResource TextBoxStyle2}">
- <Setter Property="FontSize" Value="13"/>
- <Setter Property="Foreground" Value="{DynamicResource Font.Content.Foreground}"/>
- <Setter Property="BorderBrush" Value="{DynamicResource Control.Border.Color}"/>
- <Setter Property="HorizontalContentAlignment" Value="Center"/>
- <Setter Property="VerticalContentAlignment" Value="Center"/>
- </Style>
- <Style TargetType="CheckBox" BasedOn="{StaticResource CheckBoxStyle}"/>
- <Style TargetType="ContentControl" >
- <Setter Property="Foreground" Value="{DynamicResource Font.Content.Foreground}"/>
- </Style>
- <Style TargetType="Expander">
- <Setter Property="Foreground" Value="{DynamicResource Font.Content.Foreground}"/>
- </Style>
- <Style TargetType="RadioButton" BasedOn="{StaticResource RadioButtonStyle}"/>
- <Style TargetType="GroupBox" BasedOn="{StaticResource GroupBoxTab}"/>
- <DataTemplate x:Key="HeaderTemplate">
- <StackPanel Orientation="Horizontal">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Image Grid.Column="0" Margin="10,0,8,0" Source="{DynamicResource ConfigBase}" Width="14" />
- <TextBlock Text="{Binding}" FontSize="13" Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
- </Grid>
- </StackPanel>
- </DataTemplate>
- </ResourceDictionary>
- </Grid.Resources>
- <pt:PropertyGrid Margin="1,-4,1,0"
- SelectedObject="{Binding BasicsData}"
- TabVisibility="VisibleIfMoreThanOne"
- TextBlock.Foreground="{DynamicResource Font.Content.Foreground}"
- Foreground="{DynamicResource Font.Content.Foreground}"
- BorderBrush="{DynamicResource Control.Border.Color}"
- CategoryHeaderTemplate="{StaticResource HeaderTemplate}"/>
- </Grid>
- </Grid>
- <!--功能模块与信息-->
- <Grid Grid.Column="1" >
- <Grid.RowDefinitions>
- <RowDefinition Height="auto"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
-
- <ToggleButton Grid.Row="0" Grid.RowSpan="2" VerticalAlignment="Top" HorizontalAlignment="Left" Margin="8,8,0,0" ToolTip="基础数据[隐藏/显示]" Panel.ZIndex="3" IsChecked="{Binding BasicsData_ToggleButtonIsChecked}">
- <ToggleButton.Template>
- <ControlTemplate TargetType="{x:Type ToggleButton}">
- <Image x:Name="image" Source="{DynamicResource GoLeft_Two}" Stretch="Fill" Width="15" Height="15" />
- <ControlTemplate.Triggers>
- <Trigger Property="IsChecked" Value="True">
- <Setter Property="Source" TargetName="image" Value="{DynamicResource GoRight_Two}"/>
- </Trigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </ToggleButton.Template>
- <ToggleButton.Triggers>
- <EventTrigger RoutedEvent="ToggleButton.Unchecked">
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Storyboard.TargetName="propertyGrid" Storyboard.TargetProperty="Width" From="0" To="550" Duration="0:0:0.7"/>
- <ThicknessAnimationUsingKeyFrames Storyboard.TargetName="propertyGrid" Storyboard.TargetProperty="Margin" BeginTime="00:00:00">
- <SplineThicknessKeyFrame KeyTime="00:00:00" Value="0" />
- <SplineThicknessKeyFrame KeyTime="00:00:0.7" Value="0,0,3,0" />
- </ThicknessAnimationUsingKeyFrames>
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- <EventTrigger RoutedEvent="ToggleButton.Checked">
- <BeginStoryboard>
- <Storyboard>
- <DoubleAnimation Storyboard.TargetName="propertyGrid" Storyboard.TargetProperty="Width" From="550" To="0" Duration="0:0:0.7"/>
- <ThicknessAnimationUsingKeyFrames Storyboard.TargetName="propertyGrid" Storyboard.TargetProperty="Margin" BeginTime="00:00:00">
- <SplineThicknessKeyFrame KeyTime="00:00:00" Value="0,0,3,0" />
- <SplineThicknessKeyFrame KeyTime="00:00:0.7" Value="0" />
- </ThicknessAnimationUsingKeyFrames>
- </Storyboard>
- </BeginStoryboard>
- </EventTrigger>
- </ToggleButton.Triggers>
- </ToggleButton>
-
- <!--功能模块-->
- <GroupBox Style="{StaticResource GroupBoxTab}" Margin="0" Grid.Row="0">
- <GroupBox.Header>
- <StackPanel Orientation="Horizontal">
- <Grid Background="transparent">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Image Grid.Column="0" Margin="10,0,8,0" Source="{DynamicResource Function}" Width="14" />
- <TextBlock Text="功能" FontSize="13" Margin="0,0,10,0" Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
- </Grid>
- </StackPanel>
- </GroupBox.Header>
- <!--■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■-->
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="auto"/>
- <RowDefinition Height="*"/>
- </Grid.RowDefinitions>
- <!--Start / Stop-->
- <Grid Grid.Row="0" Grid.Column="1" Margin="0,-40,0,0">
- <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" >
- <btn:ButtonControl Grid.Column="5" Width="80" Command="{Binding Start}" HorizontalAlignment="Right" VerticalAlignment="Center" BorderThickness="1,0,0,0"
- IsMouseOverBorderBrushColor="{DynamicResource Control.Border.One.Color}"
- BorderBrush="{DynamicResource Control.Border.Color}"
- IsPressedBorderBrushColor="{DynamicResource Control.Border.Two.Color}"
- Foreground="{DynamicResource Font.Content.Foreground}"
- Icon="{DynamicResource ConnectBase}"
- Content="连接"/>
- <btn:ButtonControl Grid.Column="6" Width="80" Command="{Binding Stop}" HorizontalAlignment="Right" VerticalAlignment="Center" BorderThickness="1,0,0,0"
- IsMouseOverBorderBrushColor="{DynamicResource Control.Border.One.Color}"
- BorderBrush="{DynamicResource Control.Border.Color}"
- IsPressedBorderBrushColor="{DynamicResource Control.Border.Two.Color}"
- Foreground="{DynamicResource Font.Content.Foreground}"
- Icon="{DynamicResource OffConnect}"
- Content="断开"/>
- </StackPanel>
- </Grid>
- <!--发送区域-->
- <Grid Grid.Row="1" Grid.Column="1">
- <Grid Margin="7">
- <Grid.RowDefinitions>
- <RowDefinition/>
- <RowDefinition/>
- <RowDefinition/>
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition/>
- <ColumnDefinition Width="auto"/>
- <ColumnDefinition Width="auto"/>
- </Grid.ColumnDefinitions>
- <GroupBox Grid.ColumnSpan="3" Style="{StaticResource GroupBoxTab}" Margin="0,1,0,10">
- <GroupBox.Header>
- <StackPanel Orientation="Horizontal">
- <Grid Background="transparent">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Image Grid.Column="0" Margin="10,0,8,0" Source="{DynamicResource DataType}" Width="14" />
- <TextBlock Text="数据类型" FontSize="13" Margin="0,0,10,0" Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
- </Grid>
- </StackPanel>
- </GroupBox.Header>
- <Grid Margin="7">
- <Grid.ColumnDefinitions>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- <ColumnDefinition/>
- </Grid.ColumnDefinitions>
- <RadioButton Grid.Column="0" ToolTip="数据类型" IsChecked="{Binding DataType,Mode=TwoWay,Converter={StaticResource CheckConverter},ConverterParameter=0}" Style="{StaticResource RadioButtonStyle}" Content="String" VerticalAlignment="Center" HorizontalAlignment="Center" />
- <RadioButton Grid.Column="1" ToolTip="数据类型" IsChecked="{Binding DataType,Mode=TwoWay,Converter={StaticResource CheckConverter},ConverterParameter=1}" Style="{StaticResource RadioButtonStyle}" Content="Double" VerticalAlignment="Center" HorizontalAlignment="Center" />
- <RadioButton Grid.Column="2" ToolTip="数据类型" IsChecked="{Binding DataType,Mode=TwoWay,Converter={StaticResource CheckConverter},ConverterParameter=2}" Style="{StaticResource RadioButtonStyle}" Content="Float" VerticalAlignment="Center" HorizontalAlignment="Center" />
- <RadioButton Grid.Column="3" ToolTip="数据类型" IsChecked="{Binding DataType,Mode=TwoWay,Converter={StaticResource CheckConverter},ConverterParameter=3}" Style="{StaticResource RadioButtonStyle}" Content="Int" VerticalAlignment="Center" HorizontalAlignment="Center" />
- <RadioButton Grid.Column="4" ToolTip="数据类型" IsChecked="{Binding DataType,Mode=TwoWay,Converter={StaticResource CheckConverter},ConverterParameter=4}" Style="{StaticResource RadioButtonStyle}" Content="Bool" VerticalAlignment="Center" HorizontalAlignment="Center" />
- </Grid>
- </GroupBox>
- <txt:TextBoxControl Grid.Column="0" Grid.Row="1" FontSize="13" HorizontalContentAlignment="Center" Text="{Binding DotAddress}"
- SelectedColor="{DynamicResource Control.Border.Two.Color}"
- BorderBrush="{DynamicResource Control.Border.Color}"
- Foreground="{DynamicResource Font.Content.Foreground}"
- Icon="{DynamicResource Dot}"
- HintColor="{DynamicResource Control.Border.One.Color}"
- ShowIcon="True"
- Hint="节点地址"
- CornerRadius="{DynamicResource WindowCornerRadius}" />
- <txt:TextBoxControl Grid.Column="0" Grid.Row="2" Margin="0,10,0,0" FontSize="13" HorizontalContentAlignment="Center" VerticalAlignment="Center" Text="{Binding WriteInData}"
- SelectedColor="{DynamicResource Control.Border.Two.Color}"
- BorderBrush="{DynamicResource Control.Border.Color}"
- Foreground="{DynamicResource Font.Content.Foreground}"
- Icon="{DynamicResource WriteIn}"
- HintColor="{DynamicResource Control.Border.One.Color}"
- ShowIcon="True"
- Hint="写入数据"
- CornerRadius="{DynamicResource WindowCornerRadius}" />
- <btn:ButtonControl Width="100" Grid.Row="1" Grid.Column="1" Command="{Binding Read}" HorizontalAlignment="Center" VerticalAlignment="Center" CornerRadius="{DynamicResource WindowCornerRadius}" Margin="10,0,0,0"
- IsMouseOverBorderBrushColor="{DynamicResource Control.Border.One.Color}"
- BorderBrush="{DynamicResource Control.Border.Color}"
- IsPressedBorderBrushColor="{DynamicResource Control.Border.Two.Color}"
- Foreground="{DynamicResource Font.Content.Foreground}"
- Icon="{DynamicResource Read}"
- Content="读取"/>
- <btn:ButtonControl Width="100" Grid.Row="2" Grid.Column="1" Command="{Binding Write}" HorizontalAlignment="Center" VerticalAlignment="Center" CornerRadius="{DynamicResource WindowCornerRadius}" Margin="10,10,0,0"
- IsMouseOverBorderBrushColor="{DynamicResource Control.Border.One.Color}"
- BorderBrush="{DynamicResource Control.Border.Color}"
- IsPressedBorderBrushColor="{DynamicResource Control.Border.Two.Color}"
- Foreground="{DynamicResource Font.Content.Foreground}"
- Icon="{DynamicResource Write}"
- Content="写入"/>
- <btn:ButtonControl Width="100" Grid.Row="1" Grid.Column="2" Command="{Binding Subscribe}" HorizontalAlignment="Center" VerticalAlignment="Center" CornerRadius="{DynamicResource WindowCornerRadius}" Margin="10,0,0,0"
- IsMouseOverBorderBrushColor="{DynamicResource Control.Border.One.Color}"
- BorderBrush="{DynamicResource Control.Border.Color}"
- IsPressedBorderBrushColor="{DynamicResource Control.Border.Two.Color}"
- Foreground="{DynamicResource Font.Content.Foreground}"
- Icon="{DynamicResource Subscribe}"
- Content="订阅"/>
- <btn:ButtonControl Width="100" Grid.Row="2" Grid.Column="2" Command="{Binding UnSubscribe}" HorizontalAlignment="Center" VerticalAlignment="Center" CornerRadius="{DynamicResource WindowCornerRadius}" Margin="10,10,0,0"
- IsMouseOverBorderBrushColor="{DynamicResource Control.Border.One.Color}"
- BorderBrush="{DynamicResource Control.Border.Color}"
- IsPressedBorderBrushColor="{DynamicResource Control.Border.Two.Color}"
- Foreground="{DynamicResource Font.Content.Foreground}"
- Icon="{DynamicResource UnSubscribe}"
- Content="取消订阅"/>
- </Grid>
- </Grid>
- </Grid>
- <!--■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■-->
- </GroupBox>
- <!--信息-->
- <GroupBox Style="{StaticResource GroupBoxTab}" Margin="0,5,0,0" Grid.Row="1">
- <GroupBox.Header>
- <StackPanel Orientation="Horizontal">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto"/>
- <ColumnDefinition Width="*"/>
- </Grid.ColumnDefinitions>
- <Image Grid.Column="0" Margin="10,0,8,0" Source="{DynamicResource Info}" Width="14" />
- <TextBlock Text="信息" FontSize="13" Margin="0,0,10,0" Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" VerticalAlignment="Center"/>
- </Grid>
- </StackPanel>
- </GroupBox.Header>
- <Grid>
- <Grid.RowDefinitions>
- <RowDefinition Height="auto" />
- <RowDefinition />
- </Grid.RowDefinitions>
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition Width="auto" />
- </Grid.ColumnDefinitions>
- <StackPanel Orientation="Horizontal" Grid.Column="1" HorizontalAlignment="Right" Margin="0,-40,0,0">
- <RadioButton ToolTip="显示方式" Margin="0,0,15,0" Visibility="{Binding AsciiVisibility}" IsChecked="{Binding InfoFormat,Mode=TwoWay,Converter={StaticResource CheckConverter},ConverterParameter=0}" Style="{StaticResource RadioButtonStyle}" Content="ASCII" VerticalAlignment="Center" HorizontalAlignment="Right" />
- <RadioButton ToolTip="显示方式" Margin="0,0,15,0" Visibility="{Binding HexVisibility}" IsChecked="{Binding InfoFormat,Mode=TwoWay,Converter={StaticResource CheckConverter},ConverterParameter=1}" Style="{StaticResource RadioButtonStyle}" Content="Hex" VerticalAlignment="Center" HorizontalAlignment="Right" />
- <btn:ButtonControl Width="80" Command="{Binding Clear}" HorizontalAlignment="Right" VerticalAlignment="Center" BorderThickness="1,0,0,0"
- IsMouseOverBorderBrushColor="{DynamicResource Control.Border.One.Color}"
- BorderBrush="{DynamicResource Control.Border.Color}"
- IsPressedBorderBrushColor="{DynamicResource Control.Border.Two.Color}"
- Foreground="{DynamicResource Font.Content.Foreground}"
- Icon="{DynamicResource Clear}"
- Content="清空"/>
- </StackPanel>
- <TextBox Grid.Row="1" Padding="5" Grid.ColumnSpan="2" Style="{DynamicResource TextBoxStyle2}" FontSize="13" VerticalContentAlignment="Top" HorizontalContentAlignment="Left" TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Visible" Text="{Binding Info}" >
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="TextChanged">
- <mvvm:EventCommand Command="{Binding Info_TextChanged}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- </TextBox>
- </Grid>
- </GroupBox>
- </Grid>
- <!--■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■-->
- <!--节点浏览-->
- <Grid Grid.Column="2" Width="0" x:Name="nodeBrowse">
- <GroupBox Style="{StaticResource GroupBoxTab}" Margin="4,0,0,0">
- <GroupBox.Header>
- <StackPanel Orientation="Horizontal">
- <Grid Background="transparent">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Image Grid.Column="0" Margin="10,0,8,0" Source="{DynamicResource Menu}" Width="14" />
- <TextBlock Text="节点信息浏览" FontSize="13" Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
- </Grid>
- </StackPanel>
- </GroupBox.Header>
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="260" />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <!--节点-->
- <Grid Grid.Column="0">
- <GroupBox Style="{StaticResource GroupBoxTab}" Margin="0,0,5,0">
- <GroupBox.Header>
- <StackPanel Orientation="Horizontal">
- <Grid Background="transparent">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Image Grid.Column="0" Margin="10,0,8,0" Source="{DynamicResource DotBase}" Width="14" />
- <TextBlock Text="节点" FontSize="13" Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
- </Grid>
- </StackPanel>
- </GroupBox.Header>
- <TreeView Background="Transparent" Margin="5,5,0,5" BorderBrush="{DynamicResource Control.Border.Color}" ItemsSource="{Binding Node}" Style="{StaticResource TreeViewStyle}" >
- <!--右键菜单暂不使用-->
- <!--<TreeView.ContextMenu>
- <ContextMenu VerticalContentAlignment="Center" FontSize="13">
- <MenuItem Header="批量订阅" Foreground="{DynamicResource Font.Content.Foreground}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Click">
- <mvvm:EventCommand Command="{Binding ContextMenu_Subscribe}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <MenuItem.Icon>
- <StackPanel Orientation="Horizontal">
- <Image Source="{DynamicResource Subscribe}" Width="15" Height="15" VerticalAlignment="Center" />
- </StackPanel>
- </MenuItem.Icon>
- </MenuItem>
- <MenuItem Header="取消批量订阅" Foreground="{DynamicResource Font.Content.Foreground}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Click">
- <mvvm:EventCommand Command="{Binding ContextMenu_UnSubscribe}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <MenuItem.Icon>
- <StackPanel Orientation="Horizontal">
- <Image Source="{DynamicResource UnSubscribe}" Width="15" Height="15" VerticalAlignment="Center" />
- </StackPanel>
- </MenuItem.Icon>
- </MenuItem>
- <MenuItem Header="导出节点" Foreground="{DynamicResource Font.Content.Foreground}">
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="Click">
- <mvvm:EventCommand Command="{Binding ContextMenu_ExpNode}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <MenuItem.Icon>
- <StackPanel Orientation="Horizontal">
- <Image Source="{DynamicResource Exp}" Width="15" Height="15" VerticalAlignment="Center" />
- </StackPanel>
- </MenuItem.Icon>
- </MenuItem>
- </ContextMenu>
- </TreeView.ContextMenu>-->
- <i:Interaction.Triggers>
- <!--选中-->
- <i:EventTrigger EventName="SelectedItemChanged">
- <mvvm:EventCommand Command="{Binding TreeView_SelectedItemChanged}" />
- </i:EventTrigger>
- <!--右键按下暂不使用-->
- <!--<i:EventTrigger EventName="PreviewMouseRightButtonDown">
- <mvvm:EventCommand Command="{Binding TreeView_PreviewMouseRightButtonDown}" />
- </i:EventTrigger>-->
- <!--项被展开-->
- <mvvm:RoutedEventTrigger RoutedEvent="TreeViewItem.Expanded">
- <mvvm:EventCommand Command="{Binding TreeViewItem_Expanded}" />
- </mvvm:RoutedEventTrigger>
- </i:Interaction.Triggers>
- <TreeView.ItemTemplate>
- <HierarchicalDataTemplate DataType="{x:Type NodeStructuralBody:NodeStructuralBody}" ItemsSource="{Binding Children}">
- <StackPanel Margin="0,5,0,5">
- <Grid>
- <Grid.ColumnDefinitions>
- <ColumnDefinition />
- <ColumnDefinition />
- <ColumnDefinition />
- </Grid.ColumnDefinitions>
- <Image VerticalAlignment="Center" HorizontalAlignment="Center" Stretch="Fill" Source="{Binding Icon}" Width="11" Height="11" Margin="0,0,5,0" Grid.Column="0" />
- <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Name}" FontSize="13" Foreground="{DynamicResource Font.Content.Foreground}" Grid.Column="1" Margin="0,0,5,0" />
- <TextBlock VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Count}" FontSize="11" Foreground="{DynamicResource Font.Content.Foreground}" Grid.Column="2" />
- </Grid>
- </StackPanel>
- </HierarchicalDataTemplate>
- </TreeView.ItemTemplate>
- </TreeView>
- </GroupBox>
- </Grid>
- <!--信息-->
- <Grid Grid.Column="1">
- <GroupBox Style="{StaticResource GroupBoxTab}" Margin="0">
- <GroupBox.Header>
- <StackPanel Orientation="Horizontal">
- <Grid Background="transparent">
- <Grid.ColumnDefinitions>
- <ColumnDefinition Width="auto" />
- <ColumnDefinition Width="*" />
- </Grid.ColumnDefinitions>
- <Image Grid.Column="0" Margin="10,0,8,0" Source="{DynamicResource Default}" Width="14" />
- <TextBlock Text="详情" FontSize="13" Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
- </Grid>
- </StackPanel>
- </GroupBox.Header>
- <DataGrid ColumnHeaderHeight="40" ItemsSource="{Binding NodeMessage}" Grid.Row="0" FontSize="13" SelectedItem="{Binding NodeMessageSelectedItem}" BorderThickness="0">
- <!--双击-->
- <i:Interaction.Triggers>
- <i:EventTrigger EventName="SelectedCellsChanged">
- <mvvm:EventCommand Command="{Binding DataGrid_SelectedCellsChanged}" />
- </i:EventTrigger>
- </i:Interaction.Triggers>
- <DataGrid.Columns>
- <DataGridTextColumn Header="名称" Width="auto" Binding="{Binding Name}" Visibility="Collapsed" />
- <DataGridTextColumn Header="地址" Width="*" Binding="{Binding Address}" />
- <DataGridTextColumn Header="值" Width="150" Binding="{Binding Value}" />
- <DataGridTextColumn Header="类型" Width="120" Binding="{Binding Type}" />
- <DataGridTextColumn Header="访问级别" Width="150" Binding="{Binding AccessLevel}" />
- <DataGridTextColumn Header="描述" Width="100" Binding="{Binding Description}" />
- </DataGrid.Columns>
- </DataGrid>
- </GroupBox>
- </Grid>
- </Grid>
- </GroupBox>
- </Grid>
- <!--■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■-->
- </Grid>
- </GroupBox>
- </Border>
- </UserControl>
|