|
|
@@ -4,18 +4,32 @@
|
|
|
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:c="clr-namespace:YSAI.Tool.Wpf.controllers"
|
|
|
- xmlns:btn="clr-namespace:YSAI.Core.Wpf.controls.button;assembly=YSAI.Core.Wpf"
|
|
|
xmlns:lang="http://wpflocalizeextension.codeplex.com"
|
|
|
lang:LocalizeDictionary.DesignCulture="zh"
|
|
|
lang:ResxLocalizationProvider.DefaultAssembly="YSAI.Langs"
|
|
|
lang:ResxLocalizationProvider.DefaultDictionary="Lang"
|
|
|
- xmlns:cs="clr-namespace:YSAI.Core.Wpf.converters;assembly=YSAI.Core.Wpf">
|
|
|
+
|
|
|
+ xmlns:c="clr-namespace:YSAI.Tool.Wpf.controllers"
|
|
|
+ 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:TcpClientController />
|
|
|
</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" />
|
|
|
@@ -29,160 +43,265 @@
|
|
|
<ResourceDictionary Source="pack://application:,,,/YSAI.Core.Wpf;component/resources/style/Style_TreeDataGrid.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_ContextMenu.xaml" />
|
|
|
</ResourceDictionary.MergedDictionaries>
|
|
|
</ResourceDictionary>
|
|
|
</UserControl.Resources>
|
|
|
- <Grid Width="620" Height="720">
|
|
|
- <Border CornerRadius="{DynamicResource WindowCornerRadius}" Background="{DynamicResource WindowContentBackground}">
|
|
|
- <Border.Effect>
|
|
|
- <BlurEffect Radius="0" />
|
|
|
- </Border.Effect>
|
|
|
- </Border>
|
|
|
- <GroupBox Style="{StaticResource GroupBoxTab}" Width="auto">
|
|
|
+
|
|
|
+ <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 Background="Transparent">
|
|
|
<Grid.ColumnDefinitions>
|
|
|
<ColumnDefinition Width="auto" />
|
|
|
<ColumnDefinition Width="*" />
|
|
|
</Grid.ColumnDefinitions>
|
|
|
- <Image Grid.Column="0" Margin="10,0,8,0" Source="{DynamicResource Communication}" Width="14" />
|
|
|
- <TextBlock Text="TCP 客户端工具" FontSize="13" Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
|
|
|
+ <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.RowDefinitions>
|
|
|
- <RowDefinition Height="70" />
|
|
|
- <RowDefinition Height="200" />
|
|
|
- <RowDefinition Height="400" />
|
|
|
- </Grid.RowDefinitions>
|
|
|
- <!--设置区域-->
|
|
|
- <GroupBox Style="{StaticResource GroupBoxStyle}" Grid.Row="0" Margin="5">
|
|
|
- <GroupBox.Header>
|
|
|
- <Border>
|
|
|
- <TextBlock Text="{lang:Loc SetRegion}" Foreground="{DynamicResource Font.Head.Foreground}" />
|
|
|
- </Border>
|
|
|
- </GroupBox.Header>
|
|
|
- <!--设置区域-->
|
|
|
- <Grid>
|
|
|
- <Grid.ColumnDefinitions>
|
|
|
- <ColumnDefinition Width="auto" />
|
|
|
- <ColumnDefinition Width="140" />
|
|
|
- <ColumnDefinition Width="auto" />
|
|
|
- <ColumnDefinition Width="80" />
|
|
|
- <ColumnDefinition Width="*" />
|
|
|
- <ColumnDefinition Width="auto" />
|
|
|
- <ColumnDefinition Width="auto" />
|
|
|
- </Grid.ColumnDefinitions>
|
|
|
- <Label Content="{lang:Loc ServerIP}" Grid.Column="0" Foreground="{DynamicResource Font.Content.Foreground}" HorizontalAlignment="Right" VerticalAlignment="Center" />
|
|
|
- <TextBox Text="{Binding ServerIP,UpdateSourceTrigger=PropertyChanged}" Margin="0,0,5,0" Grid.Column="1" Style="{StaticResource TextBoxStyle2}" Height="30" Foreground="{DynamicResource Font.Content.Foreground}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
|
|
|
- <Label Content="{lang:Loc ServerPort}" Grid.Column="2" Foreground="{DynamicResource Font.Content.Foreground}" HorizontalAlignment="Right" VerticalAlignment="Center" />
|
|
|
- <TextBox Text="{Binding ServerPort,UpdateSourceTrigger=PropertyChanged}" Margin="0,0,5,0" Grid.Column="3" Style="{StaticResource TextBoxStyle2}" Height="30" Foreground="{DynamicResource Font.Content.Foreground}" HorizontalContentAlignment="Center" VerticalContentAlignment="Center" />
|
|
|
-
|
|
|
- <btn:ButtonControl Grid.Column="5" Width="90" Margin="0,0,5,0" Command="{Binding Connect}" HorizontalAlignment="Right" 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 ConnectBase}"
|
|
|
- Content="{lang:Loc Connect}"
|
|
|
- CornerRadius="{DynamicResource WindowCornerRadius}" />
|
|
|
-
|
|
|
- <btn:ButtonControl Grid.Column="6" Width="90" Margin="0,0,10,0" Command="{Binding OffConnect}" HorizontalAlignment="Right" 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 OffConnect}"
|
|
|
- Content="{lang:Loc Break}"
|
|
|
- CornerRadius="{DynamicResource WindowCornerRadius}" />
|
|
|
-
|
|
|
- </Grid>
|
|
|
- </GroupBox>
|
|
|
- <!--发送区域-->
|
|
|
- <GroupBox Style="{StaticResource GroupBoxStyle}" Grid.Row="1" Margin="5">
|
|
|
- <GroupBox.Header>
|
|
|
- <Border>
|
|
|
- <TextBlock Text="{lang:Loc SendRegion}" Foreground="{DynamicResource Font.Head.Foreground}" />
|
|
|
- </Border>
|
|
|
- </GroupBox.Header>
|
|
|
- <Grid>
|
|
|
- <Grid.RowDefinitions>
|
|
|
- <RowDefinition Height="45" />
|
|
|
- <RowDefinition />
|
|
|
- </Grid.RowDefinitions>
|
|
|
- <Grid.ColumnDefinitions>
|
|
|
- <ColumnDefinition Width="65" />
|
|
|
- <ColumnDefinition Width="150" />
|
|
|
- <ColumnDefinition Width="78" />
|
|
|
- <ColumnDefinition Width="80" />
|
|
|
- <ColumnDefinition Width="55" />
|
|
|
- <ColumnDefinition Width="60" />
|
|
|
- <ColumnDefinition Width="auto" />
|
|
|
- </Grid.ColumnDefinitions>
|
|
|
- <Label Content="{lang:Loc [SendMode]}" Grid.Column="2" Grid.ColumnSpan="2" Foreground="{DynamicResource Font.Content.Foreground}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0" />
|
|
|
- <RadioButton IsChecked="{Binding SendDataFormat,Mode=TwoWay,Converter={StaticResource CheckConverter},ConverterParameter=0}" Grid.Column="4" Style="{StaticResource RadioButtonStyle}" Content="ASCII" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
|
|
- <RadioButton IsChecked="{Binding SendDataFormat,Mode=TwoWay,Converter={StaticResource CheckConverter},ConverterParameter=1}" Grid.Column="5" Style="{StaticResource RadioButtonStyle}" Content="Hex" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
|
|
-
|
|
|
- <btn:ButtonControl Width="80" Command="{Binding Send}" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,0" Grid.Column="6"
|
|
|
- IsMouseOverBorderBrushColor="{DynamicResource Control.Border.One.Color}"
|
|
|
- BorderBrush="{DynamicResource Control.Border.Color}"
|
|
|
- IsPressedBorderBrushColor="{DynamicResource Control.Border.Two.Color}"
|
|
|
- Foreground="{DynamicResource Font.Content.Foreground}"
|
|
|
- Icon="{DynamicResource Send}"
|
|
|
- Content="{lang:Loc Send}"
|
|
|
- CornerRadius="{DynamicResource WindowCornerRadius}" />
|
|
|
- <GroupBox Style="{StaticResource GroupBoxStyle}" Grid.Row="1" Grid.ColumnSpan="7">
|
|
|
- <GroupBox.Header>
|
|
|
- <Border>
|
|
|
- <TextBlock Text="{lang:Loc DataRegion}" Foreground="{DynamicResource Font.Head.Foreground}" />
|
|
|
- </Border>
|
|
|
- </GroupBox.Header>
|
|
|
- <TextBox Style="{DynamicResource TextBoxStyle2}" VerticalContentAlignment="Top" HorizontalContentAlignment="Left" TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Visible" Margin="5" Text="{Binding SendData,UpdateSourceTrigger=PropertyChanged}" Height="auto" Width="545" />
|
|
|
- </GroupBox>
|
|
|
- </Grid>
|
|
|
- </GroupBox>
|
|
|
- <!--接收区域-->
|
|
|
- <GroupBox Style="{StaticResource GroupBoxStyle}" Grid.Row="2" Margin="5">
|
|
|
- <GroupBox.Header>
|
|
|
- <Border>
|
|
|
- <TextBlock Text="{lang:Loc ReceptionRegion}" Foreground="{DynamicResource Font.Head.Foreground}" />
|
|
|
- </Border>
|
|
|
- </GroupBox.Header>
|
|
|
- <Grid>
|
|
|
- <Grid.RowDefinitions>
|
|
|
- <RowDefinition Height="45" />
|
|
|
- <RowDefinition />
|
|
|
- </Grid.RowDefinitions>
|
|
|
- <Grid.ColumnDefinitions>
|
|
|
- <ColumnDefinition />
|
|
|
- <ColumnDefinition Width="55" />
|
|
|
- <ColumnDefinition Width="55" />
|
|
|
- <ColumnDefinition Width="90" />
|
|
|
- </Grid.ColumnDefinitions>
|
|
|
- <Label Content="{lang:Loc DisplayMode}" Grid.Column="0" Foreground="{DynamicResource Font.Content.Foreground}" VerticalAlignment="Center" HorizontalAlignment="Right" Margin="0,0,10,0" />
|
|
|
- <RadioButton IsChecked="{Binding ReceiveDataFormat,Mode=TwoWay,Converter={StaticResource CheckConverter},ConverterParameter=0}" Grid.Column="1" Style="{StaticResource RadioButtonStyle}" Content="ASCII" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
|
|
- <RadioButton IsChecked="{Binding ReceiveDataFormat,Mode=TwoWay,Converter={StaticResource CheckConverter},ConverterParameter=1}" Grid.Column="2" Style="{StaticResource RadioButtonStyle}" Content="Hex" VerticalAlignment="Center" HorizontalAlignment="Center" />
|
|
|
- <btn:ButtonControl Grid.Column="3" Width="80" Margin="0,0,10,0" Command="{Binding Empty}" HorizontalAlignment="Left" 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 Clear}"
|
|
|
- Content="{lang:Loc Empty}"
|
|
|
- CornerRadius="{DynamicResource WindowCornerRadius}" />
|
|
|
- <GroupBox Style="{StaticResource GroupBoxStyle}" Grid.Row="1" Grid.ColumnSpan="7">
|
|
|
- <GroupBox.Header>
|
|
|
- <Border>
|
|
|
- <TextBlock Text="{lang:Loc DataRegion}" Foreground="{DynamicResource Font.Head.Foreground}" />
|
|
|
- </Border>
|
|
|
- </GroupBox.Header>
|
|
|
- <TextBox Style="{DynamicResource TextBoxStyle2}" VerticalContentAlignment="Top" HorizontalContentAlignment="Left" TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Visible" Margin="5" Text="{Binding ReceiveData,UpdateSourceTrigger=PropertyChanged}" Height="auto" Width="545" />
|
|
|
- </GroupBox>
|
|
|
+ <!--基础数据与功能区域-->
|
|
|
+ <Grid >
|
|
|
+ <Grid.ColumnDefinitions>
|
|
|
+ <ColumnDefinition Width="auto"/>
|
|
|
+ <ColumnDefinition Width="*"/>
|
|
|
+ </Grid.ColumnDefinitions>
|
|
|
+ <!--基础数据-->
|
|
|
+ <Grid Grid.Column="0" Margin="0,0,5,0" Width="500">
|
|
|
+ <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="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="Height" Value="25"/>
|
|
|
+ <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>
|
|
|
- </GroupBox>
|
|
|
+ </Grid>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <!--功能模块与信息-->
|
|
|
+ <Grid Grid.Column="1" MinWidth="600">
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition Height="auto"/>
|
|
|
+ <RowDefinition Height="*"/>
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+ <!--功能模块-->
|
|
|
+ <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 Open}"
|
|
|
+ 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 CloseBase}"
|
|
|
+ Content="关闭"/>
|
|
|
+ </StackPanel>
|
|
|
+ </Grid>
|
|
|
+ <!--发送区域-->
|
|
|
+ <Grid Grid.Row="1" Grid.Column="1">
|
|
|
+ <Grid.RowDefinitions>
|
|
|
+ <RowDefinition/>
|
|
|
+ <RowDefinition/>
|
|
|
+ </Grid.RowDefinitions>
|
|
|
+ <StackPanel Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,0,0,-30">
|
|
|
+ <RadioButton ToolTip="发送方式" Margin="0,0,15,0" Visibility="{Binding AsciiVisibility}" IsChecked="{Binding DataFormat,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 DataFormat,Mode=TwoWay,Converter={StaticResource CheckConverter},ConverterParameter=1}" Style="{StaticResource RadioButtonStyle}" Content="Hex" VerticalAlignment="Center" HorizontalAlignment="Right" />
|
|
|
+ <btn:ButtonControl Grid.Column="3" Width="80" Command="{Binding Send}" 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 Send}"
|
|
|
+ Content="发送"/>
|
|
|
+ </StackPanel>
|
|
|
+ <GroupBox Style="{StaticResource GroupBoxTab}" Grid.Row="1" Grid.ColumnSpan="8" Width="auto" Margin="0,0,0,0">
|
|
|
+ <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 Data}" 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>
|
|
|
+ <TextBox Padding="5" Style="{DynamicResource TextBoxStyle2}" Height="230" VerticalContentAlignment="Top" HorizontalContentAlignment="Left" TextWrapping="Wrap" AcceptsReturn="True" VerticalScrollBarVisibility="Visible" Text="{Binding SendData}" />
|
|
|
+ </GroupBox>
|
|
|
+ </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>
|
|
|
</GroupBox>
|
|
|
- </Grid>
|
|
|
+ </Border>
|
|
|
</UserControl>
|