Browse Source

1. 新增Ws客户端,服务端
2. 优化Ws Core
3. 串口、Tcp客户端改造完成
4. 优化终端展示界面
5. 新增第一次打开显示默认界面

Shun 2 years ago
parent
commit
edbbbe4f00

+ 8 - 7
src/YSAI.Tool.Wpf/Main.xaml

@@ -5,8 +5,9 @@
         xmlns:local="clr-namespace:YSAI.Tool.Wpf.controllers"
         Icon="image\YSAI_One.ico"
         FontFamily="{DynamicResource AllFontFamily}" WindowStartupLocation="CenterScreen" IsContentBackgroundPicture="True" ResizeMode="CanResize"
-        xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml" 
-        Title="[ 远舢智能 ] 调试工具">
+        xmlns:ui="http://schemas.lepo.co/wpfui/2022/xaml"
+                 xmlns:pages="clr-namespace:YSAI.Tool.Wpf.views"
+        Title="[ 远舢智能 ] 调试工具" >
     <Window.DataContext>
         <local:MainController />
     </Window.DataContext>
@@ -20,11 +21,11 @@
                 </ResourceDictionary.MergedDictionaries>
             </ResourceDictionary>
         </Grid.Resources>
-        <ui:NavigationView 
-    MenuItemsSource="{Binding MenuItemsSource}" 
-    FooterMenuItemsSource="{Binding FooterMenuItemsSource}" 
-    IsBackButtonVisible="Visible"
-    IsPaneToggleVisible="True">
+        <ui:NavigationView
+                    MenuItemsSource="{Binding MenuItemsSource}" 
+                    FooterMenuItemsSource="{Binding FooterMenuItemsSource}" 
+                    IsBackButtonVisible="Auto"
+                    IsPaneToggleVisible="True">
             <ui:NavigationView.AutoSuggestBox>
                 <ui:AutoSuggestBox PlaceholderText=" 搜索" >
                     <ui:AutoSuggestBox.Icon>

+ 64 - 1
src/YSAI.Tool.Wpf/Main.xaml.cs

@@ -1,7 +1,10 @@
 using System.Windows;
+using System.Windows.Media;
+using Wpf.Ui.Controls;
 using YSAI.Core.Wpf;
 using YSAI.Langs;
-
+using YSAI.Tool.Wpf.views;
+using MessageBox = YSAI.Core.Wpf.MessageBox;
 namespace YSAI.Tool.Wpf
 {
     /// <summary>
@@ -15,9 +18,27 @@ namespace YSAI.Tool.Wpf
             WindowHelper.OnSkinSwitchEvent += WindowHelper_OnSkinSwitchEvent;
             //语言发生变化
             LangsHelper.OnLangSwitchEvent += LangsHelper_OnLangSwitchEvent;
+
             InitializeComponent();
 
+            //皮肤变化设置控件模版
             WindowHelper_OnSkinSwitchEvent(WindowHelper.SkinName, null);
+            //特殊解决方案,无法直接用此控件NAME 只能使用此方法来设置第一次打开显示的界面
+            Task.Run(() =>
+            {
+                Thread.Sleep(50);
+                System.Windows.Application.Current?.Dispatcher.Invoke(delegate ()
+                {
+                    List<NavigationView> navigationViews = FindVisualChild<NavigationView>(this);
+                    if (navigationViews.Count > 0)
+                    {
+                        //第一次打开显示的界面
+                        navigationViews[0].Navigate(typeof(Serial));
+                    }
+                });
+            });
+
+
         }
         /// <summary>
         /// 语言发生变化
@@ -81,6 +102,48 @@ namespace YSAI.Tool.Wpf
                 sn = SkinName;
 
             }
+
+
+        }
+        /// <summary>
+        /// 检索模版下指定控件集
+        /// </summary>
+        /// <typeparam name="T"></typeparam>
+        /// <param name="obj"></param>
+        /// <returns></returns>
+        List<T> FindVisualChild<T>(DependencyObject obj) where T : DependencyObject
+        {
+            try
+            {
+                List<T> TList = new List<T> { };
+                for (int i = 0; i < VisualTreeHelper.GetChildrenCount(obj); i++)
+                {
+                    DependencyObject child = VisualTreeHelper.GetChild(obj, i);
+                    if (child != null && child is T)
+                    {
+                        TList.Add((T)child);
+                        List<T> childOfChildren = FindVisualChild<T>(child);
+                        if (childOfChildren != null)
+                        {
+                            TList.AddRange(childOfChildren);
+                        }
+                    }
+                    else
+                    {
+                        List<T> childOfChildren = FindVisualChild<T>(child);
+                        if (childOfChildren != null)
+                        {
+                            TList.AddRange(childOfChildren);
+                        }
+                    }
+                }
+                return TList;
+            }
+            catch (Exception ee)
+            {
+                MessageBox.Show(ee.Message);
+                return null;
+            }
         }
     }
 }

+ 3 - 2
src/YSAI.Tool.Wpf/YSAI.Tool.Wpf.csproj

@@ -17,7 +17,7 @@
 		<PackageReference Include="PropertyTools.Wpf" Version="3.1.0" />
 		<PackageReference Include="WPF-UI" Version="3.0.0-preview.13" />
 		<PackageReference Include="Microsoft.Web.WebView2" Version="1.0.2210.55" />
-		<PackageReference Include="YSAI.AllenBradley" Version="23.353.7802" />
+		<!--<PackageReference Include="YSAI.AllenBradley" Version="23.353.7802" />
 		<PackageReference Include="YSAI.Beckhoff" Version="23.353.7802" />
 		<PackageReference Include="YSAI.DB" Version="23.353.7802" />
 		<PackageReference Include="YSAI.Kafka" Version="23.352.38022" />
@@ -31,10 +31,11 @@
 		<PackageReference Include="YSAI.Opc" Version="23.353.7802" />
 		<PackageReference Include="YSAI.RabbitMQ" Version="23.352.38022" />
 		<PackageReference Include="YSAI.Redis" Version="23.352.38022" />
-		<PackageReference Include="YSAI.Siemens" Version="23.353.7802" />
+		<PackageReference Include="YSAI.Siemens" Version="23.353.7802" />-->
 	</ItemGroup>
 	<ItemGroup>
 		<ProjectReference Include="..\YSAI.Core.Wpf\YSAI.Core.Wpf.csproj" />
+		<ProjectReference Include="..\YSAI.Core\YSAI.Core.csproj" />
 	</ItemGroup>
 
 	<ItemGroup>

+ 7 - 5
src/YSAI.Tool.Wpf/controllers/MainController.cs

@@ -24,6 +24,7 @@ namespace YSAI.Tool.Wpf.controllers
         {
             MenuItemsSource = new ObservableCollection<object>
             {
+
                   new NavigationViewItem()
                   {
                         NavigationCacheMode=NavigationCacheMode.Required,
@@ -33,7 +34,7 @@ namespace YSAI.Tool.Wpf.controllers
                         {
                             CreationControl(string.Format("{0,-8}{1}", "[ 客户端 ]", "UA"), SymbolRegular.DocumentTextToolbox24, typeof(AboutUs)),
                             CreationControl(string.Format("{0,-8}{1}", "[ 服务端 ]", "UA"), SymbolRegular.DesktopToolbox24, typeof(AboutUs)),
-                            CreationControl(string.Format("{0,-8}{1}", "[ 客户端 ]", "DA ( x86 run )"), SymbolRegular.ClockToolbox24, null),
+                            CreationControl(string.Format("{0,-8}{1}", "[ 客户端 ]", "DA ( x86 run )"), SymbolRegular.ClockToolbox24, typeof(AboutUs)),
                             CreationControl(string.Format("{0,-8}{1}", "[ HTTP ]", "DA"), SymbolRegular.BookToolbox24, typeof(AboutUs))
                         }
                   },
@@ -74,12 +75,11 @@ namespace YSAI.Tool.Wpf.controllers
                   },
                   CreationControl("Serial",SymbolRegular.Toolbox12,typeof(Serial)),
                   CreationControl("Svg",SymbolRegular.Toolbox12,typeof(Svg)),
-                   CreationControl("Test",SymbolRegular.Toolbox12,typeof(test)),
             };
 
             FooterMenuItemsSource = new ObservableCollection<object>
             {
-                new NavigationViewItem("关于", SymbolRegular.Info24, typeof(AboutUs))
+                 CreationControl("关于", SymbolRegular.TableMoveAbove24, typeof(AboutUs))
             };
         }
 
@@ -97,7 +97,7 @@ namespace YSAI.Tool.Wpf.controllers
         /// <summary>
         /// 菜单项数据源
         /// </summary>
-        public ObservableCollection<object> MenuItemsSource
+        public ICollection<object> MenuItemsSource
         {
             get => GetProperty(() => MenuItemsSource);
             set => SetProperty(() => MenuItemsSource, value);
@@ -105,10 +105,12 @@ namespace YSAI.Tool.Wpf.controllers
         /// <summary>
         /// 底部菜单项数据源
         /// </summary>
-        public ObservableCollection<object> FooterMenuItemsSource
+        public ICollection<object> FooterMenuItemsSource
         {
             get => GetProperty(() => FooterMenuItemsSource);
             set => SetProperty(() => FooterMenuItemsSource, value);
         }
+
+
     }
 }

+ 3 - 3
src/YSAI.Tool.Wpf/controllers/SerialController.cs

@@ -21,7 +21,7 @@ namespace YSAI.Tool.Wpf.controllers
             //初始化基础数据
             BasicsData = new Basics();
             //工具标题
-            ToolTitle = "Tcp 客户端工具";
+            ToolTitle = "串口工具";
             //配置文件名
             FileName = typeof(SerialData).Name;
             //Ascii是否显示
@@ -68,7 +68,7 @@ namespace YSAI.Tool.Wpf.controllers
             if (!string.IsNullOrEmpty(Data.RetFilePath))
             {
                 Basics? basics = FileTool.FileToString(Data.RetFilePath).ToJsonEntity<Basics>();
-                if (BasicsData == null)
+                if (basics == null)
                 {
                     Output("导入失败");
                 }
@@ -293,7 +293,7 @@ namespace YSAI.Tool.Wpf.controllers
         private void Communication_OnEvent(object? sender, EventResult e)
         {
             Output(e.Message.Replace("[", "[ ").Replace("]", " ] "));
-            if (e.State)
+            if (e.RData != null && e.RData is byte[])
             {
                 if (InfoFormat == 0)
                 {

+ 2 - 2
src/YSAI.Tool.Wpf/controllers/TcpClientController.cs

@@ -67,7 +67,7 @@ namespace YSAI.Tool.Wpf.controllers
             if (!string.IsNullOrEmpty(Data.RetFilePath))
             {
                 Basics? basics = FileTool.FileToString(Data.RetFilePath).ToJsonEntity<Basics>();
-                if (BasicsData == null)
+                if (basics == null)
                 {
                     Output("导入失败");
                 }
@@ -292,7 +292,7 @@ namespace YSAI.Tool.Wpf.controllers
         private void Communication_OnEvent(object? sender, EventResult e)
         {
             Output(e.Message.Replace("[", "[ ").Replace("]", " ] "));
-            if (e.State)
+            if (e.RData != null && e.RData is byte[])
             {
                 if (InfoFormat == 0)
                 {

+ 10 - 7
src/YSAI.Tool.Wpf/controllers/TcpServiceController.cs

@@ -74,7 +74,7 @@ namespace YSAI.Tool.Wpf.controllers
             if (!string.IsNullOrEmpty(Data.RetFilePath))
             {
                 Basics? basics = FileTool.FileToString(Data.RetFilePath).ToJsonEntity<Basics>();
-                if (BasicsData == null)
+                if (basics == null)
                 {
                     Output("导入失败");
                 }
@@ -329,13 +329,16 @@ namespace YSAI.Tool.Wpf.controllers
                     });
                     break;
                 case Steps.消息接收:
-                    if (InfoFormat == 0)
+                    if (message.Data != null)
                     {
-                        Output($"[ {message.IpPort} ] -> {Encoding.ASCII.GetString(message.Data)}", false);
-                    }
-                    else
-                    {
-                        Output($"[ {message.IpPort} ] -> {message.Data.ToHexString()}", false);
+                        if (InfoFormat == 0)
+                        {
+                            Output($"[ {message.IpPort} ] -> {Encoding.ASCII.GetString(message.Data)}", false);
+                        }
+                        else
+                        {
+                            Output($"[ {message.IpPort} ] -> {message.Data.ToHexString()}", false);
+                        }
                     }
                     break;
             }

+ 10 - 7
src/YSAI.Tool.Wpf/controllers/UdpController.cs

@@ -75,7 +75,7 @@ namespace YSAI.Tool.Wpf.controllers
             if (!string.IsNullOrEmpty(Data.RetFilePath))
             {
                 Basics? basics = FileTool.FileToString(Data.RetFilePath).ToJsonEntity<Basics>();
-                if (BasicsData == null)
+                if (basics == null)
                 {
                     Output("导入失败");
                 }
@@ -314,13 +314,16 @@ namespace YSAI.Tool.Wpf.controllers
             {
                 return;
             }
-            if (InfoFormat == 0)
+            if (message.Data != null)
             {
-                Output($"[ {message.IpPort} ] -> {Encoding.ASCII.GetString(message.Data)}", false);
-            }
-            else
-            {
-                Output($"[ {message.IpPort} ] -> {message.Data.ToHexString()}", false);
+                if (InfoFormat == 0)
+                {
+                    Output($"[ {message.IpPort} ] -> {Encoding.ASCII.GetString(message.Data)}", false);
+                }
+                else
+                {
+                    Output($"[ {message.IpPort} ] -> {message.Data.ToHexString()}", false);
+                }
             }
         }
     }

+ 2 - 2
src/YSAI.Tool.Wpf/controllers/WsClientController.cs

@@ -64,7 +64,7 @@ namespace YSAI.Tool.Wpf.controllers
             if (!string.IsNullOrEmpty(Data.RetFilePath))
             {
                 Basics? basics = FileTool.FileToString(Data.RetFilePath).ToJsonEntity<Basics>();
-                if (BasicsData == null)
+                if (basics == null)
                 {
                     Output("导入失败");
                 }
@@ -289,7 +289,7 @@ namespace YSAI.Tool.Wpf.controllers
         private void Communication_OnEvent(object? sender, EventResult e)
         {
             Output(e.Message.Replace("[", "[ ").Replace("]", " ] "));
-            if (e.State)
+            if (e.RData != null && e.RData is byte[])
             {
                 if (InfoFormat == 0)
                 {

+ 10 - 7
src/YSAI.Tool.Wpf/controllers/WsServiceController.cs

@@ -69,7 +69,7 @@ namespace YSAI.Tool.Wpf.controllers
             if (!string.IsNullOrEmpty(Data.RetFilePath))
             {
                 Basics? basics = FileTool.FileToString(Data.RetFilePath).ToJsonEntity<Basics>();
-                if (BasicsData == null)
+                if (basics == null)
                 {
                     Output("导入失败");
                 }
@@ -324,13 +324,16 @@ namespace YSAI.Tool.Wpf.controllers
                     });
                     break;
                 case Steps.消息接收:
-                    if (InfoFormat == 0)
+                    if (message.Data != null)
                     {
-                        Output($"[ {message.IpPort} ] -> {Encoding.ASCII.GetString(message.Data)}", false);
-                    }
-                    else
-                    {
-                        Output($"[ {message.IpPort} ] -> {message.Data.ToHexString()}", false);
+                        if (InfoFormat == 0)
+                        {
+                            Output($"[ {message.IpPort} ] -> {Encoding.ASCII.GetString(message.Data)}", false);
+                        }
+                        else
+                        {
+                            Output($"[ {message.IpPort} ] -> {message.Data.ToHexString()}", false);
+                        }
                     }
                     break;
             }

+ 0 - 250
src/YSAI.Tool.Wpf/test.xaml

@@ -1,250 +0,0 @@
-<UserControl x:Class="YSAI.Tool.Wpf.test"
-             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:c="clr-namespace:YSAI.Tool.Wpf"
-             
-             
-             
-             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:testC />
-    </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_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>
-
-    <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="*"/>
-                </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>
-                </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>
-                        <!--■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■-->
-
-
-
-
-
-                        
-
-
-
-
-                        <!--■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■■-->
-                    </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  Padding="5" Grid.Row="1" 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>
-    </Border>
-
-
-
-
-</UserControl>

+ 0 - 15
src/YSAI.Tool.Wpf/test.xaml.cs

@@ -1,15 +0,0 @@
-using System.Windows.Controls;
-
-namespace YSAI.Tool.Wpf
-{
-    /// <summary>
-    /// test.xaml 的交互逻辑
-    /// </summary>
-    public partial class test : UserControl
-    {
-        public test()
-        {
-            InitializeComponent();
-        }
-    }
-}

+ 0 - 181
src/YSAI.Tool.Wpf/testC.cs

@@ -1,181 +0,0 @@
-using YSAI.Core.Wpf.mvvm;
-namespace YSAI.Tool.Wpf
-{
-    public class testC : NotifyObject
-    {
-        public testC()
-        {
-            ////初始化基础数据
-            //BasicsData = new Basics();
-            ////工具标题
-            //ToolTitle = "OpcUa 客户端工具";
-            ////配置文件名
-            //FileName = typeof(OpcUaClientData).Name;
-            ////Ascii是否显示
-            //AsciiVisibility = Visibility.Visible;
-            ////Hex是否显示
-            //HexVisibility = Visibility.Visible;
-            ////信息格式;  0 ASCII ; 1 HEX
-            //InfoFormat = 0;
-        }
-
-        #region 统一需要的数据
-        ///// <summary>
-        ///// 导出的文件名
-        ///// </summary>
-        //private string FileName { get; set; }
-        ///// <summary>
-        ///// 工具标题
-        ///// </summary>
-        //public string ToolTitle
-        //{
-        //    get => GetProperty(() => ToolTitle);
-        //    set => SetProperty(() => ToolTitle, value);
-        //}
-        ///// <summary>
-        ///// 数据源
-        ///// </summary>
-        //public Basics BasicsData
-        //{
-        //    get => GetProperty(() => BasicsData);
-        //    set => SetProperty(() => BasicsData, value);
-        //}
-
-        ///// <summary>
-        ///// 导入基础数据命令
-        ///// </summary>
-        //public ICommand IncBasics { get => new CommandX(OnIncBasics); }
-
-        ///// <summary>
-        ///// 导入基础数据
-        ///// </summary>
-        //public void OnIncBasics()
-        //{
-        //    (string RetFilePath, string RetFileName) Data = Unility.Windows.FileTool.SelectFiles("json");
-        //    if (!string.IsNullOrEmpty(Data.RetFilePath))
-        //    {
-        //        Basics? basics = FileTool.FileToString(Data.RetFilePath).ToJsonEntity<Basics>();
-        //        if (BasicsData == null)
-        //        {
-        //            Output("导入失败");
-        //        }
-        //        else
-        //        {
-        //            Output("导入成功");
-        //            BasicsData = basics;
-        //        }
-        //    }
-        //}
-
-        ///// <summary>
-        ///// 导出基础数据命令
-        ///// </summary>
-        //public ICommand ExpBasics { get => new CommandX(OnExpBasics); }
-
-        ///// <summary>
-        ///// 导出基础数据
-        ///// </summary>
-        //public void OnExpBasics()
-        //{
-        //    string path = Unility.Windows.FileTool.SelectFolder();
-        //    if (!string.IsNullOrEmpty(path))
-        //    {
-        //        FileTool.StringToFile(Path.Combine(path, $"{FileName}[{DateTime.Now.ToString("yyyyMMddHHmmss")}].json"), BasicsData.ToJson());
-        //        Output("导出成功");
-        //    }
-        //}
-
-        ///// <summary>
-        ///// 信息
-        ///// </summary>
-        //public string Info
-        //{
-        //    get => GetProperty(() => Info);
-        //    set => SetProperty(() => Info, value);
-        //}
-
-        ///// <summary>
-        ///// 信息框事件
-        ///// </summary>
-        //public ICommand Info_TextChanged { get => new CommandX<System.Windows.Controls.TextChangedEventArgs>(OnInfo_TextChanged); }
-
-        ///// <summary>
-        ///// 信息框事件
-        ///// 让滚动条一直处在最下方
-        ///// </summary>
-        //public void OnInfo_TextChanged(System.Windows.Controls.TextChangedEventArgs e)
-        //{
-        //    System.Windows.Controls.TextBox textBox = (System.Windows.Controls.TextBox)e.Source;
-        //    textBox.SelectionStart = textBox.Text.Length;
-        //    textBox.SelectionLength = 0;
-        //    textBox.ScrollToEnd();
-        //}
-
-        ///// <summary>
-        ///// 输出标准消息
-        ///// </summary>
-        ///// <param name="Data">数据</param>
-        ///// <param name="IsDate">需要时间</param>
-        //private void Output(string Data, bool IsDate = true)
-        //{
-        //    System.Windows.Application.Current?.Dispatcher.Invoke(delegate ()
-        //    {
-        //        if (Info?.Length > 5000)
-        //        {
-        //            Info = string.Empty;
-        //        }
-        //        if (IsDate)
-        //        {
-        //            Info += $" {DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss.fff")} : {Data}\r\n";
-        //        }
-        //        else
-        //        {
-        //            Info += $"{Data}\r\n";
-        //        }
-        //    });
-        //}
-
-        ///// <summary>
-        ///// ascii
-        ///// </summary>
-        //public Visibility AsciiVisibility
-        //{
-        //    get => GetProperty(() => AsciiVisibility);
-        //    set => SetProperty(() => AsciiVisibility, value);
-        //}
-        ///// <summary>
-        ///// hex
-        ///// </summary>
-        //public Visibility HexVisibility
-        //{
-        //    get => GetProperty(() => HexVisibility);
-        //    set => SetProperty(() => HexVisibility, value);
-        //}
-
-        ///// <summary>
-        ///// 接收数据格式
-        ///// 0 ASCII
-        ///// 1 HEX
-        ///// </summary>
-        //public int InfoFormat
-        //{
-        //    get => GetProperty(() => InfoFormat);
-        //    set => SetProperty(() => InfoFormat, value);
-        //}
-
-        ///// <summary>
-        ///// 清空信息命令
-        ///// </summary>
-        //public ICommand Clear { get => new CommandX(OnClear); }
-
-        ///// <summary>
-        ///// 清空信息
-        ///// </summary>
-        //public void OnClear()
-        //{
-        //    Info = string.Empty;
-        //}
-
-        #endregion 统一需要的数据
-    }
-}

+ 1 - 1
src/YSAI.Tool.Wpf/views/AboutUs.xaml

@@ -4,6 +4,6 @@
              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:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf">
+             xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf" Background="{DynamicResource ContentBackgroundPicture}">
     <wv2:WebView2  Name="webView" />
 </UserControl>

+ 1 - 1
src/YSAI.Tool.Wpf/views/AboutUs.xaml.cs

@@ -14,7 +14,7 @@ namespace YSAI.Tool.Wpf.views
             //设置缓存目录
             webView.EnsureCoreWebView2Async(CoreWebView2Environment.CreateAsync(null, "cache").Result);
             //设置地址
-            webView.Source = new Uri("http://www.yuanshan-ai.com/list/45.html");
+            webView.Source = new Uri("http://www.yuanshan-ai.com/");
         }
     }
 }

+ 1 - 207
src/YSAI.Tool.Wpf/views/TcpService.xaml

@@ -4,12 +4,12 @@
              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:lang="http://wpflocalizeextension.codeplex.com"
             lang:LocalizeDictionary.DesignCulture="zh"
             lang:ResxLocalizationProvider.DefaultAssembly="YSAI.Langs"
             lang:ResxLocalizationProvider.DefaultDictionary="Lang"
              
+              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"
@@ -339,210 +339,4 @@ Content="清空"/>
         </GroupBox>
     </Border>
 
-
-    <!--#region 暂不使用 -->
-    <!--<UserControl.Resources>
-        <ResourceDictionary>
-            <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_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.MergedDictionaries>
-        </ResourceDictionary>
-    </UserControl.Resources>
-    <Grid  Width="890" Height="720">
-        <Border  CornerRadius="{DynamicResource WindowCornerRadius}"  Background="{DynamicResource WindowContentBackground}">
-            <Border.Effect>
-                <BlurEffect Radius="0" />
-            </Border.Effect>
-        </Border>
-        <GroupBox Style="{StaticResource GroupBoxTab}" Width="auto">
-            <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 Communication}" Width="14" />
-                        <TextBlock Text="TCP 服务端工具" FontSize="13"  Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
-                    </Grid>
-                </StackPanel>
-            </GroupBox.Header>
-            <Grid>
-                <Grid.ColumnDefinitions>
-                    <ColumnDefinition />
-                    <ColumnDefinition Width="270" />
-                </Grid.ColumnDefinitions>
-                <Grid.RowDefinitions>
-                    <RowDefinition Height="70" />
-                    <RowDefinition Height="200" />
-                    <RowDefinition  Height="400" />
-                </Grid.RowDefinitions>
-                --><!--设置区域--><!--
-                <GroupBox Style="{StaticResource GroupBoxStyle}" Grid.Row="0" Margin="5" Grid.Column="0">
-                    <GroupBox.Header>
-                        <Border>
-                            <TextBlock Text="{lang:Loc SetRegion}" Foreground="{DynamicResource Font.Head.Foreground}" />
-                        </Border>
-                    </GroupBox.Header>
-                    --><!--设置区域--><!--
-                    <Grid>
-                        <Grid.ColumnDefinitions>
-                            <ColumnDefinition Width="auto" />
-                            <ColumnDefinition Width="150" />
-                            <ColumnDefinition Width="auto" />
-                            <ColumnDefinition Width="80" />
-                            <ColumnDefinition Width="*" />
-                            <ColumnDefinition Width="auto" />
-                            <ColumnDefinition  Width="auto" />
-                        </Grid.ColumnDefinitions>
-                        <Label Content="{lang:Loc LocalIP}" Grid.Column="0" Foreground="{DynamicResource Font.Content.Foreground}" HorizontalAlignment="Right" VerticalAlignment="Center" />
-                        <ComboBox Grid.Column="1"  Height="30" Style="{StaticResource ComboBoxStyle}" Background="White" VerticalAlignment="Center"
-                          ItemsSource="{Binding DataList,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
-                          DisplayMemberPath="Name"
-                          SelectedItem="{Binding SelectedData,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}"
-                          SelectedValue="Name" />
-                        <Label Content="{lang:Loc LocalPort}" Grid.Column="2" Foreground="{DynamicResource Font.Content.Foreground}" HorizontalAlignment="Right" VerticalAlignment="Center" />
-                        <TextBox Text="{Binding LocalPort,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="80"  Command="{Binding Start}" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,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 Start}"
-                                            Content="{lang:Loc Start}"
-                                            CornerRadius="{DynamicResource WindowCornerRadius}" />
-
-                        <btn:ButtonControl  Grid.Column="6"  Width="80"  Command="{Binding Stop}" HorizontalAlignment="Right" VerticalAlignment="Center" Margin="0,0,10,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 Stop}"
-                                             Content="{lang:Loc Stop}"
-                                             CornerRadius="{DynamicResource WindowCornerRadius}" />
-                    </Grid>
-                </GroupBox>
-                --><!--发送区域--><!--
-                <GroupBox Style="{StaticResource GroupBoxStyle}" Grid.Row="1" Margin="5" Grid.Column="0">
-                    <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 />
-                            <ColumnDefinition Width="55" />
-                            <ColumnDefinition  Width="55" />
-                            <ColumnDefinition  Width="90" />
-                        </Grid.ColumnDefinitions>
-                        <CheckBox Margin="0,0,10,0"  IsChecked="{Binding MassData}" Content="{lang:Loc FSend}" Grid.Column="0" VerticalAlignment="Center"  HorizontalAlignment="Right" Style="{StaticResource CheckBoxStyle}" Foreground="{DynamicResource Font.Content.Foreground}" />
-                        <RadioButton IsChecked="{Binding SendDataFormat,Mode=TwoWay,Converter={StaticResource CheckConverter},ConverterParameter=0}"  Grid.Column="1" Style="{StaticResource RadioButtonStyle}" Content="ASCII" VerticalAlignment="Center" HorizontalAlignment="Center"  Margin="0,0,0,0" />
-                        <RadioButton IsChecked="{Binding SendDataFormat,Mode=TwoWay,Converter={StaticResource CheckConverter},ConverterParameter=1}" Grid.Column="2"  Style="{StaticResource RadioButtonStyle}" Content="Hex"  VerticalAlignment="Center" HorizontalAlignment="Center" Margin="0,0,0,0" />
-
-                        <btn:ButtonControl  Grid.Column="3"  Width="80"  Command="{Binding Send}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0,0,10,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="{lang:Loc Send}"
-                                               CornerRadius="{DynamicResource WindowCornerRadius}" />
-
-
-                        <GroupBox Style="{StaticResource GroupBoxStyle}" Grid.Row="1"  Grid.ColumnSpan="4">
-                            <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" Grid.Column="0">
-                    <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"  Command="{Binding Clear}" HorizontalAlignment="Left" VerticalAlignment="Center" Margin="0,0,10,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="{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>
-                </GroupBox>
-                --><!--客户端列表--><!--
-                <Grid Grid.Row="0"  Grid.RowSpan="3"  Grid.Column="1">
-                    <GroupBox Style="{StaticResource GroupBoxStyle}" Grid.Row="0" Margin="5" Grid.ColumnSpan="2">
-                        <GroupBox.Header>
-                            <Border>
-                                <TextBlock Text="{lang:Loc ClientTable}" Foreground="{DynamicResource Font.Head.Foreground}" />
-                            </Border>
-                        </GroupBox.Header>
-                        <DataGrid  ColumnHeaderHeight="40" Foreground="{DynamicResource Font.Content.Foreground}" ItemsSource="{Binding DataGridData}">
-                            <i:Interaction.Triggers>
-                                <i:EventTrigger EventName="SelectionChanged">
-                                    <mvvm:EventCommand  Command="{Binding GridDataSelectionChanged}" />
-                                </i:EventTrigger>
-                            </i:Interaction.Triggers>
-                            <DataGrid.Columns>
-                                <DataGridTextColumn Header="{lang:Loc Address}"  Width="*"  Binding="{Binding IP}" />
-                                <DataGridTextColumn Header="{lang:Loc Port}"  Width="*"  Binding="{Binding Port}" />
-                            </DataGrid.Columns>
-                        </DataGrid>
-                    </GroupBox>
-                </Grid>
-            </Grid>
-        </GroupBox>
-    </Grid>-->
-    <!--#endregion-->
 </UserControl>

+ 331 - 4
src/YSAI.Tool.Wpf/views/WsService.xaml

@@ -3,8 +3,335 @@
              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">
-    <Grid>
-            
-    </Grid>
+             xmlns:local="clr-namespace:YSAI.Tool.Wpf.views"            
+             
+              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:WsServiceController />
+    </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_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>
+
+    <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="*"/>
+                </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>
+                </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>
+                            <Grid.ColumnDefinitions>
+                                <ColumnDefinition Width="200"/>
+                                <ColumnDefinition />
+                            </Grid.ColumnDefinitions>
+                            <!--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 Start}"
+                                           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 Stop}"
+                                           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">
+                                    <CheckBox Margin="0,0,10,0"  IsChecked="{Binding MassData}" Content="群发" Grid.Column="0" VerticalAlignment="Center"  HorizontalAlignment="Right" Style="{StaticResource CheckBoxStyle}" Foreground="{DynamicResource Font.Content.Foreground}" />
+                                    <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="4,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 Grid.Row="0" Grid.RowSpan="2" Grid.Column="0">
+                                <GroupBox Style="{StaticResource GroupBoxTab}" Grid.Row="0" Grid.ColumnSpan="2" 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 User}" Width="14" />
+                                                <TextBlock Text="客户端列表" FontSize="13" Margin="0,0,10,0"  Grid.Column="1" Foreground="{DynamicResource Font.Content.Foreground}" />
+                                            </Grid>
+                                        </StackPanel>
+                                    </GroupBox.Header>
+                                    <DataGrid  ColumnHeaderHeight="40" Foreground="{DynamicResource Font.Content.Foreground}" ItemsSource="{Binding DataGridData}">
+                                        <i:Interaction.Triggers>
+                                            <i:EventTrigger EventName="SelectionChanged">
+                                                <mvvm:EventCommand  Command="{Binding GridDataSelectionChanged}" />
+                                            </i:EventTrigger>
+                                        </i:Interaction.Triggers>
+                                        <DataGrid.Columns>
+                                            <DataGridTextColumn Header="地址"  Width="*"  Binding="{Binding IP}" />
+                                            <DataGridTextColumn Header="端口"  Width="*"  Binding="{Binding Port}" />
+                                        </DataGrid.Columns>
+                                    </DataGrid>
+                                </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>
+    </Border>
 </UserControl>