Browse Source

版本更新

Shun 2 years ago
parent
commit
8524673db9

+ 2 - 2
src/YSAI.AllenBradley/YSAI.AllenBradley.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.338.19976</Version>
+    <Version>23.342.4025</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -16,6 +16,6 @@
     <Description>$(DescriptionType):$(DescriptionName) ( $(DescriptionDetails) )</Description>
   </PropertyGroup>
   <ItemGroup>
-    <PackageReference Include="YSAI.Core" Version="23.338.19544" />
+    <PackageReference Include="YSAI.Core" Version="23.342.3461" />
   </ItemGroup>
 </Project>

+ 2 - 2
src/YSAI.Beckhoff/YSAI.Beckhoff.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.338.19977</Version>
+    <Version>23.342.4026</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -17,6 +17,6 @@
   </PropertyGroup>
   <ItemGroup>
     <PackageReference Include="Beckhoff.TwinCAT.Ads" Version="6.1.125" />
-    <PackageReference Include="YSAI.Core" Version="23.338.19544" />
+    <PackageReference Include="YSAI.Core" Version="23.342.3461" />
   </ItemGroup>
 </Project>

+ 2 - 2
src/YSAI.Can/YSAI.Can.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.338.19977</Version>
+    <Version>23.342.4026</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -16,7 +16,7 @@
     <Description>$(DescriptionType):$(DescriptionName) ( $(DescriptionDetails) )</Description>
   </PropertyGroup>
   <ItemGroup>
-    <PackageReference Include="YSAI.Core" Version="23.338.19544" />
+    <PackageReference Include="YSAI.Core" Version="23.342.3461" />
   </ItemGroup>
   <ItemGroup>
     <Reference Include="Kvaser.CanLib">

+ 21 - 18
src/YSAI.Controls/tabcontrol/TabControl.xaml

@@ -13,22 +13,23 @@
 
             <BooleanToVisibilityConverter x:Key="boolConverter"/>
             <l:InverseBooleanConverter x:Key="_inverseBooleanConverter"/>
-            <!-- 
-		Brushes used to define the Look of the TabControl & TabItem
-	-->
-            <!-- Border Brush for the TabItems and TabControl -->
+            <!-- 笔刷用于定义TabControl和TabItem的外观-->
+            
+            <!-- TabItems和TabControl的边框刷 -->
             <SolidColorBrush x:Key="TabBorderBrush" Color="LightGray"/>
-            <!-- Tab Text Colour when Not Selected-->
+            
+            <!-- 未选中时的标签文本颜色-->
             <SolidColorBrush x:Key="TabGrayTextBrush" Color="#FF444444"/>
-            <!-- TabItem CloseButton Brush-->
+            
+            <!-- 关闭按钮刷-->
             <SolidColorBrush x:Key="TabCloseButtonBrush" Color="#FFADADAD"/>
 
-            <!-- TabItem Brushes -->
+            <!-- TabItem -->
             <SolidColorBrush x:Key="TabItemNormalBackground" Color="WhiteSmoke"/>
             <SolidColorBrush x:Key="TabItemHoverBackground" Color="LightGray"/>
             <SolidColorBrush x:Key="TabItemSelectedBackground" Color="LightGray"/>
 
-            <!-- Style for the Repeat Button used to scrool the Tabs to the Left-->
+            <!-- 用于将选项卡向左滚动的重复按钮的样式-->
             <Style x:Key="RepeatButtonScrollLeftOrUpStyle" TargetType="{x:Type RepeatButton}">
                 <Setter Property="Foreground" Value="{StaticResource TabGrayTextBrush}" />
                 <Setter Property="Background" Value="{Binding Path=TabItemNormalBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}"/>
@@ -84,7 +85,7 @@
                 </Setter>
             </Style>
 
-            <!-- Style for the Repeat Button used to scrool the Tabs to the Right-->
+            <!-- 用于向右滚动选项卡的重复按钮的样式-->
             <Style x:Key="RepeatButtonScrollRightOrDownStyle" TargetType="{x:Type RepeatButton}">
                 <Setter Property="Foreground" Value="{StaticResource TabGrayTextBrush}" />
                 <Setter Property="Background" Value="{Binding Path=TabItemNormalBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}"/>
@@ -142,7 +143,7 @@
                 </Setter>
             </Style>
 
-            <!-- Style for the Toggle Button which displays a cntext menu listing all the Tab Headers-->
+            <!-- 切换按钮的样式,该按钮显示一个包含所有选项卡标头的文本菜单-->
             <Style x:Key="DropDownToggleButtonStyle" TargetType="{x:Type ToggleButton}">
                 <Setter Property="Background" Value="{Binding Path=TabItemNormalBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}"/>
                 <Setter Property="BorderBrush" Value="{Binding Path=BorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}"/>
@@ -183,7 +184,7 @@
                 </Setter>
             </Style>
 
-            <!-- Style for the New Tab Button -->
+            <!-- 新建选项卡按钮的样式 -->
             <Style x:Key="NewTabButtonStyle" TargetType="{x:Type Button}">
                 <Setter Property="Background" Value="{Binding Path=TabItemNormalBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}"/>
                 <Setter Property="BorderBrush" Value="{Binding Path=BorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}"/>
@@ -224,7 +225,7 @@
                 </Setter>
             </Style>
 
-            <!-- Style for the Close Button on each TabItem -->
+            <!-- 样式用于每个TabItem上的关闭按钮 -->
             <Style x:Key="CloseButtonStyle" TargetType="{x:Type Button}">
                 <Setter Property="BorderBrush" Value="Transparent"/>
                 <Setter Property="Background" Value="Transparent"/>
@@ -267,7 +268,7 @@
                 </Setter>
             </Style>
 
-            <!-- TabItem Style, defines the look of a Tab Item-->
+            <!-- TabItem样式,定义了选项卡项的外观-->
             <Style TargetType="{x:Type l:TabItem}">
                 <Setter Property="Background" Value="{Binding Path=TabItemNormalBackground, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}"/>
                 <Setter Property="BorderBrush" Value="{Binding Path=BorderBrush, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type l:TabControl}}}"/>
@@ -403,7 +404,7 @@
                 </Setter>
             </Style>
 
-            <!-- Control Template for TabStripPlacement Top-->
+            <!-- 控件模板的TabStripPlacement顶部-->
             <ControlTemplate x:Key="TabControlTabPlacementTop" TargetType="{x:Type l:TabControl}">
                 <Grid SnapsToDevicePixels="{Binding Path=SnapsToDevicePixels, RelativeSource={RelativeSource TemplatedParent}}" KeyboardNavigation.TabNavigation="Local">
                     <Grid.ColumnDefinitions>
@@ -495,7 +496,7 @@
                 </Grid>
             </ControlTemplate>
 
-            <!-- Control Template for TabStripPlacement Bottom-->
+            <!-- 控件模板TabStripPlacement底部-->
             <ControlTemplate x:Key="TabControlTabPlacementBottom" TargetType="{x:Type l:TabControl}">
                 <Grid SnapsToDevicePixels="{Binding Path=SnapsToDevicePixels, RelativeSource={RelativeSource TemplatedParent}}" KeyboardNavigation.TabNavigation="Local">
                     <Grid.ColumnDefinitions>
@@ -587,7 +588,7 @@
                 </Grid>
             </ControlTemplate>
 
-            <!-- Control Template for TabStripPlacement Left-->
+            <!-- 控制模板TabStripPlacement左-->
             <ControlTemplate x:Key="TabControlTabPlacementLeft" TargetType="{x:Type l:TabControl}">
                 <Grid SnapsToDevicePixels="{Binding Path=SnapsToDevicePixels, RelativeSource={RelativeSource TemplatedParent}}" KeyboardNavigation.TabNavigation="Local">
                     <Grid.RowDefinitions>
@@ -662,7 +663,7 @@
                 </Grid>
             </ControlTemplate>
 
-            <!-- Control Template for TabStripPlacement Right-->
+            <!-- 控制模板的标签条放置权-->
             <ControlTemplate x:Key="TabControlTabPlacementRight" TargetType="{x:Type l:TabControl}">
                 <Grid SnapsToDevicePixels="{Binding Path=SnapsToDevicePixels, RelativeSource={RelativeSource TemplatedParent}}" KeyboardNavigation.TabNavigation="Local">
                     <Grid.RowDefinitions>
@@ -737,7 +738,8 @@
                     </Border>
                 </Grid>
             </ControlTemplate>
-            <!-- TabControl Style, defines the look of the TabControl-->
+
+            <!-- TabControl样式,定义TabControl的外观-->
             <Style TargetType="{x:Type l:TabControl}">
                 <Setter Property="KeyboardNavigation.TabNavigation" Value="Cycle"/>
                 <Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Cycle"/>
@@ -780,6 +782,7 @@
                     </Trigger>
                 </Style.Triggers>
             </Style>
+            
         </ResourceDictionary>
     </TabControl.Resources>
 </TabControl>

+ 1 - 1
src/YSAI.Core/YSAI.Core.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.338.19544</Version>
+    <Version>23.342.3461</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>

+ 2 - 2
src/YSAI.DB/YSAI.DB.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.338.19977</Version>
+    <Version>23.342.4026</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -21,6 +21,6 @@
     <PackageReference Include="System.Data.OracleClient" Version="1.0.8" />
     <PackageReference Include="System.Data.SqlClient" Version="4.8.5" />
     <PackageReference Include="System.Data.SQLite" Version="1.0.118" />
-    <PackageReference Include="YSAI.Core" Version="23.338.19544" />
+    <PackageReference Include="YSAI.Core" Version="23.342.3461" />
   </ItemGroup>
 </Project>

+ 2 - 2
src/YSAI.Mewtocol/YSAI.Mewtocol.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.338.19977</Version>
+    <Version>23.342.4026</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -17,6 +17,6 @@
   </PropertyGroup>
   <ItemGroup>
     <PackageReference Include="Mewtocol.NET" Version="0.8.1" />
-    <PackageReference Include="YSAI.Core" Version="23.338.19544" />
+    <PackageReference Include="YSAI.Core" Version="23.342.3461" />
   </ItemGroup>
 </Project>

+ 2 - 2
src/YSAI.Mitsubishi/YSAI.Mitsubishi.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.340.9645</Version>
+    <Version>23.342.4026</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -16,6 +16,6 @@
     <Description>$(DescriptionType):$(DescriptionName) ( $(DescriptionDetails) )</Description>
   </PropertyGroup>
   <ItemGroup>
-    <PackageReference Include="YSAI.Core" Version="23.338.19544" />
+    <PackageReference Include="YSAI.Core" Version="23.342.3461" />
   </ItemGroup>
 </Project>

+ 2 - 2
src/YSAI.Modbus/YSAI.Modbus.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.338.19977</Version>
+    <Version>23.342.4026</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -18,6 +18,6 @@
   <ItemGroup>
     <PackageReference Include="NModbus" Version="3.0.81" />
     <PackageReference Include="NModbus.Serial" Version="3.0.81" />
-    <PackageReference Include="YSAI.Core" Version="23.338.19544" />
+    <PackageReference Include="YSAI.Core" Version="23.342.3461" />
   </ItemGroup>
 </Project>

+ 2 - 2
src/YSAI.Omron/YSAI.Omron.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.338.19977</Version>
+    <Version>23.342.4026</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -16,6 +16,6 @@
     <Description>$(DescriptionType):$(DescriptionName) ( $(DescriptionDetails) )</Description>
   </PropertyGroup>
   <ItemGroup>
-    <PackageReference Include="YSAI.Core" Version="23.338.19544" />
+    <PackageReference Include="YSAI.Core" Version="23.342.3461" />
   </ItemGroup>
 </Project>

+ 2 - 2
src/YSAI.Opc/YSAI.Opc.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.338.19977</Version>
+    <Version>23.342.4026</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -17,6 +17,6 @@
   </PropertyGroup>
   <ItemGroup>
     <PackageReference Include="OPCFoundation.NetStandard.Opc.Ua" Version="1.4.372.76" />
-    <PackageReference Include="YSAI.Core" Version="23.338.19544" />
+    <PackageReference Include="YSAI.Core" Version="23.342.3461" />
   </ItemGroup>
 </Project>

+ 2 - 2
src/YSAI.Siemens/YSAI.Siemens.csproj

@@ -3,7 +3,7 @@
     <TargetFrameworks>net6.0;net8.0</TargetFrameworks>
     <ImplicitUsings>enable</ImplicitUsings>
     <Nullable>enable</Nullable>
-    <Version>23.341.4890</Version>
+    <Version>23.342.4026</Version>
     <PackageOutputPath Condition="'$(Configuration)' == 'Release'">../YSAI.Publish/Release</PackageOutputPath>
     <PackageOutputPath Condition="'$(Configuration)' == 'Debug'">../YSAI.Publish/Debug</PackageOutputPath>
     <Authors>Shun</Authors>
@@ -17,6 +17,6 @@
   </PropertyGroup>
   <ItemGroup>
     <PackageReference Include="S7netplus" Version="0.20.0" />
-    <PackageReference Include="YSAI.Core" Version="23.338.19544" />
+    <PackageReference Include="YSAI.Core" Version="23.342.3461" />
   </ItemGroup>
 </Project>

+ 41 - 3
src/YSAI.Tests/Program.cs

@@ -548,17 +548,55 @@ address.CreationTime = DateTime.Now.ToLocalTime();
 address.AddressArray = new List<AddressDetails>();
 address.AddressArray.Add(new AddressDetails()
 {
-    AddressName = "DB71.DBD4",    //地址格式  DB*.DBD*
-    AddressDataType = DataType.String,
+    AddressName = "DB71.DBD420",    //地址格式  DB*.DBD*
+    AddressDataType = DataType.Float,
     AddressType = AddressType.Reality
 });
+address.AddressArray.Add(new AddressDetails()
+{
+    AddressName = "DB71.DBD424",    //地址格式  DB*.DBD*
+    AddressDataType = DataType.Float,
+    AddressType = AddressType.Reality
+});
+address.AddressArray.Add(new AddressDetails()
+{
+    AddressName = "DB71.DBD428",    //地址格式  DB*.DBD*
+    AddressDataType = DataType.Float,
+    AddressType = AddressType.Reality
+});
+address.AddressArray.Add(new AddressDetails()
+{
+    AddressName = "DB72.DBD114",    //地址格式  DB*.DBD*
+    AddressDataType = DataType.Float,
+    AddressType = AddressType.Reality
+});
+address.AddressArray.Add(new AddressDetails()
+{
+    AddressName = "DB72.DBD110",    //地址格式  DB*.DBD*
+    AddressDataType = DataType.Float,
+    AddressType = AddressType.Reality
+});
+address.AddressArray.Add(new AddressDetails()
+{
+    AddressName = "DB71.DBD256",    //地址格式  DB*.DBD*
+    AddressDataType = DataType.Float,
+    AddressType = AddressType.Reality
+});
+address.AddressArray.Add(new AddressDetails()
+{
+    AddressName = "DB71.DBD388",    //地址格式  DB*.DBD*
+    AddressDataType = DataType.Float,
+    AddressType = AddressType.Reality
+});
+
+//Source array was not long enough. Check the source index, length, and the array's lower bounds. (Parameter 'sourceArray')
 
 //读取
 operateResult = s7ClientOperate.Read(address);
 Console.WriteLine(operateResult.Message);
 if (operateResult.State)
 {
-    foreach (var item in operateResult.RData as ConcurrentDictionary<string, AddressValue>)
+    foreach (var item in operateResult.GetRData<ConcurrentDictionary<string, AddressValue>>())
     {
         Console.WriteLine(item.Key);
         Console.WriteLine(item.Value.Value);

+ 2 - 2
src/YSAI.Tests/YSAI.Tests.csproj

@@ -103,7 +103,7 @@
 
 
 	<ItemGroup>
-		<ProjectReference Include="..\YSAI.AllenBradley\YSAI.AllenBradley.csproj" />
+		<!--<ProjectReference Include="..\YSAI.AllenBradley\YSAI.AllenBradley.csproj" />
 		<ProjectReference Include="..\YSAI.Beckhoff\YSAI.Beckhoff.csproj" />
 		<ProjectReference Include="..\YSAI.Can\YSAI.Can.csproj" />
 		<ProjectReference Include="..\YSAI.DAQ.Samples.Reflection\YSAI.DAQ.Samples.Reflection.csproj" />
@@ -117,7 +117,7 @@
 		<ProjectReference Include="..\YSAI.Netty\YSAI.Netty.csproj" />
 		<ProjectReference Include="..\YSAI.Omron\YSAI.Omron.csproj" />
 		<ProjectReference Include="..\YSAI.Opc\YSAI.Opc.csproj" />
-		<ProjectReference Include="..\YSAI.RabbitMQ\YSAI.RabbitMQ.csproj" />
+		<ProjectReference Include="..\YSAI.RabbitMQ\YSAI.RabbitMQ.csproj" />-->
 		<ProjectReference Include="..\YSAI.Siemens\YSAI.Siemens.csproj" />
 	</ItemGroup>
 	

+ 121 - 85
src/YSAI.Tool/MainWindow.xaml

@@ -39,96 +39,132 @@
             </hm:HamburgerMenu>
         </Border>
         <Grid Grid.Column="1">
-            <TabControl ItemsSource="{Binding TabControlItemsSource}"  TabStripPlacement="Top" VerticalContentAlignment="Center" SelectedItem="{Binding TabControlSelectedItem}" Background="Transparent" BorderBrush="Transparent">
-                <TabControl.ItemTemplate>
-                    <DataTemplate>
-                        <Grid Background="Transparent">
-                            <Grid.ColumnDefinitions>
-                                <ColumnDefinition/>
-                                <ColumnDefinition/>
-                                <ColumnDefinition/>
-                            </Grid.ColumnDefinitions>
-                            <Image Grid.Column="0" Source="{Binding Icon}" Height="16" Width="16" Margin="2,0,2,0" VerticalAlignment="Center"/>
-                            <TextBlock Grid.Column="1" Text="{Binding Title}" />
-                            <Button Grid.Column="2" Name="PART_CloseButton"  Height="auto" Width="20" WindowChrome.IsHitTestVisibleInChrome="True">
-                                <!--关闭按钮的模版-->
-                                <Button.Template>
-                                    <ControlTemplate  TargetType="{x:Type Button}">
-                                        <Border TextBlock.Foreground="{TemplateBinding Foreground}" x:Name="Border">
-                                            <Border.BorderBrush>
-                                                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
-                                                    <LinearGradientBrush.GradientStops>
-                                                        <GradientStopCollection>
-                                                            <GradientStop Color="{DynamicResource BorderLightColor}" Offset="0.0" />
-                                                            <GradientStop Color="{DynamicResource BorderDarkColor}" Offset="1.0" />
-                                                        </GradientStopCollection>
-                                                    </LinearGradientBrush.GradientStops>
-                                                </LinearGradientBrush>
-                                            </Border.BorderBrush>
-                                            <ContentPresenter Margin="2" HorizontalAlignment="Center" VerticalAlignment="Center" RecognizesAccessKey="True" />
-                                        </Border>
-                                        <ControlTemplate.Triggers>
-                                            <Trigger Property="IsDefault" Value="true">
-                                                <Setter TargetName="Border" Property="BorderBrush">
-                                                    <Setter.Value>
-                                                        <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
-                                                            <GradientBrush.GradientStops>
-                                                                <GradientStopCollection>
-                                                                    <GradientStop Color="{DynamicResource DefaultBorderBrushLightBrush}" Offset="0.0" />
-                                                                    <GradientStop Color="{DynamicResource DefaultBorderBrushDarkColor}" Offset="1.0" />
-                                                                </GradientStopCollection>
-                                                            </GradientBrush.GradientStops>
-                                                        </LinearGradientBrush>
-                                                    </Setter.Value>
-                                                </Setter>
-                                            </Trigger>
+            <TabControl ItemsSource="{Binding TabControlItemsSource}"  TabStripPlacement="Top" SelectedItem="{Binding TabControlSelectedItem}">
+                <TabControl.Resources>
+                    <!-- 笔刷用于定义TabControl和TabItem的外观-->
 
-                                            <!--没有被按下,并且鼠标还在上方-->
-                                            <MultiTrigger>
-                                                <MultiTrigger.Conditions>
-                                                    <!--被按下-->
-                                                    <Condition Property="IsPressed" Value="False" />
-                                                    <!--鼠标在上方-->
-                                                    <Condition Property="IsMouseOver" Value="True" />
-                                                </MultiTrigger.Conditions>
-                                                <Setter Property="Opacity" TargetName="Border" Value="0.8" />
-                                                <Setter Property="Background" TargetName="Border" Value="{DynamicResource CloseCaptionButtonBackgroundBrush}" />
-                                            </MultiTrigger>
+                    <!-- TabItems和TabControl的边框刷 -->
+                    <SolidColorBrush x:Key="TabBorderBrush" Color="LightGray"/>
 
-                                            <!--被按下,并且鼠标还在上方-->
-                                            <MultiTrigger>
-                                                <MultiTrigger.Conditions>
-                                                    <!--被按下-->
-                                                    <Condition Property="IsPressed" Value="True" />
-                                                    <!--鼠标在上方-->
-                                                    <Condition Property="IsMouseOver" Value="True" />
-                                                </MultiTrigger.Conditions>
-                                                <Setter Property="Background" TargetName="Border" Value="{DynamicResource CloseCaptionButtonPressedBackgroundBrush}" />
-                                            </MultiTrigger>
+                    <!-- 未选中时的标签文本颜色-->
+                    <SolidColorBrush x:Key="TabGrayTextBrush" Color="#FF444444"/>
 
-                                            <!--没有被按下,鼠标也不在上方-->
-                                            <MultiTrigger>
-                                                <MultiTrigger.Conditions>
-                                                    <!--被按下-->
-                                                    <Condition Property="IsPressed" Value="False" />
-                                                    <!--鼠标在上方-->
-                                                    <Condition Property="IsMouseOver" Value="False" />
-                                                </MultiTrigger.Conditions>
-                                                <Setter Property="Background" TargetName="Border" Value="Transparent" />
-                                            </MultiTrigger>
-                                        </ControlTemplate.Triggers>
-                                    </ControlTemplate>
-                                </Button.Template>
-                                <StackPanel Orientation="Horizontal">
-                                    <Image Source="{DynamicResource CloseBase}" Width="{DynamicResource CloseImageWidth}" Stretch="Uniform" />
-                                </StackPanel>
-                            </Button>
-                        </Grid>
-                    </DataTemplate>
-                </TabControl.ItemTemplate>
+                    <!-- 关闭按钮刷-->
+                    <SolidColorBrush x:Key="TabCloseButtonBrush" Color="#FFADADAD"/>
+
+                    <!-- TabItem刷 -->
+                    <SolidColorBrush x:Key="TabItemNormalBackground" Color="WhiteSmoke"/>
+                    <SolidColorBrush x:Key="TabItemHoverBackground" Color="LightGray"/>
+                    <SolidColorBrush x:Key="TabItemSelectedBackground" Color="LightGray"/>
+
+                    <!--关闭按钮的样式-->
+                    <Style x:Key="CloseButtonStyle" TargetType="{x:Type Button}">
+                        <Setter Property="BorderBrush" Value="Transparent"/>
+                        <Setter Property="Background" Value="Transparent"/>
+                        <Setter Property="Template">
+                            <Setter.Value>
+                                <ControlTemplate TargetType="{x:Type Button}">
+                                    <Border x:Name="border"  CornerRadius="2"   Background="{TemplateBinding Background}"  BorderThickness="1"  BorderBrush="{TemplateBinding BorderBrush}"  Width="16" Height="16"  SnapsToDevicePixels="True">     
+                                        <Grid Width="8" Height="8" HorizontalAlignment="Center" VerticalAlignment="Center">
+                                            <Path x:Name="path1" Stroke="{StaticResource TabCloseButtonBrush}" Data="M0,0 L8,8" StrokeThickness="2" />
+                                            <Path x:Name="path2" Stroke="{StaticResource TabCloseButtonBrush}" Data="M8,0 L0,8" StrokeThickness="2" />
+                                        </Grid>
+                                    </Border>
+                                    <ControlTemplate.Triggers>
+                                        <Trigger Property="IsMouseOver" Value="True">
+                                            <Setter Property="BorderBrush" Value="{StaticResource TabCloseButtonBrush}"/>
+                                            <Setter Property="Background" Value="WhiteSmoke"/>
+                                            <Setter Property="Stroke" TargetName="path1" Value="DarkRed"/>
+                                            <Setter Property="Stroke" TargetName="path2" Value="DarkRed"/>
+                                        </Trigger>
+                                        <Trigger Property="IsPressed" Value="True">
+                                            <Setter Property="Background">
+                                                <Setter.Value>
+                                                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
+                                                        <GradientStop Color="#FFADADAD" Offset="0"/>
+                                                        <GradientStop Color="White" Offset="0.5"/>
+                                                        <GradientStop Color="White" Offset="1"/>
+                                                    </LinearGradientBrush>
+                                                </Setter.Value>
+                                            </Setter>
+                                        </Trigger>
+                                    </ControlTemplate.Triggers>
+                                </ControlTemplate>
+                            </Setter.Value>
+                        </Setter>
+                    </Style>
+
+                    <!--选项的样式-->
+                    <Style TargetType="{x:Type TabItem}">
+                        <Setter Property="Background" Value="Transparent"/>
+                        <Setter Property="BorderBrush" Value="Transparent"/>
+                        <Setter Property="HorizontalAlignment" Value="Stretch" />
+                        <Setter Property="VerticalAlignment" Value="Stretch" />
+                        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
+                        <Setter Property="VerticalContentAlignment" Value="Stretch" />
+                        <Setter Property="SnapsToDevicePixels" Value="False"/>
+                        <Setter Property="Template">
+                            <Setter.Value>
+                                <ControlTemplate TargetType="{x:Type TabItem}">
+                                    <Border x:Name="Border" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" CornerRadius="5" VerticalAlignment="Center" HorizontalAlignment="Center">
+                                        <Grid HorizontalAlignment="Stretch">
+                                            <Grid.ColumnDefinitions>
+                                                <ColumnDefinition Width="Auto"/>
+                                                <ColumnDefinition Width="*"/>
+                                                <ColumnDefinition Width="Auto"/>
+                                            </Grid.ColumnDefinitions>
+
+                                            <Image Source="{DynamicResource Communication}" Height="20"/>
+
+                                            <TextBlock x:Name="TextBlock" Margin="5,0,0,0" Grid.Column="1"  Text="{Binding Title}" Foreground="{DynamicResource Font.Head.Foreground}" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="{DynamicResource AllFontSize}"/>
+
+                                            <Button  Command="{Binding CloseTab}" Grid.Column="2"  VerticalAlignment="Center" HorizontalAlignment="Center" Margin="5,0,5,0"  Style="{StaticResource CloseButtonStyle}" Visibility="Visible"/>
+                                        </Grid>
+                                    </Border>
+                                    <ControlTemplate.Triggers>
+                                        <!--鼠标在上方-->
+                                        <Trigger Property="IsMouseOver" Value="true">
+                                            <Setter Property="Opacity" TargetName="Border" Value="0.8" />
+                                        </Trigger>
+                                        <!--被选中-->
+                                        <Trigger Property="IsSelected" Value="true">
+                                            <Setter Property="FontWeight" TargetName="TextBlock" Value="Bold"/>
+                                            <Setter Property="TextDecorations" TargetName="TextBlock" Value="Underline"/>
+                                        </Trigger>
+                                        <!--被选中-->
+                                        <Trigger Property="IsSelected" Value="False">
+                                            <Setter Property="Background" TargetName="Border" Value="Transparent" />
+                                            <Setter Property="FontWeight" TargetName="TextBlock" Value="Normal"/>
+                                            <Setter Property="TextDecorations" TargetName="TextBlock" Value="None"/>
+                                        </Trigger>
+
+                                    </ControlTemplate.Triggers>
+                                </ControlTemplate>
+                            </Setter.Value>
+                        </Setter>
+                    </Style>
+                    <!--tab控件样式-->
+                    <Style TargetType="{x:Type TabControl}">
+                        <Setter Property="KeyboardNavigation.TabNavigation" Value="Cycle"/>
+                        <Setter Property="KeyboardNavigation.DirectionalNavigation" Value="Cycle"/>
+                        <Setter Property="HorizontalContentAlignment" Value="Center" />
+                        <Setter Property="VerticalContentAlignment" Value="Center" />
+                        <Setter Property="SnapsToDevicePixels" Value="True"/>
+                        <Setter Property="Background" Value="Transparent"/>
+                        <Setter Property="BorderBrush" Value="Transparent"/>
+                        <Setter Property="Margin" Value="0,10,0,0"/>
+                    </Style>
+                </TabControl.Resources>
                 <TabControl.ContentTemplate>
                     <DataTemplate>
-                        <ContentControl Content="{Binding UserControl}" />
+                        <Border Background="{Binding Path=Background, RelativeSource={RelativeSource TemplatedParent}}" 
+                                 BorderBrush="{Binding Path=BorderBrush, RelativeSource={RelativeSource TemplatedParent}}"
+                                 BorderThickness="{Binding Path=BorderThickness, RelativeSource={RelativeSource TemplatedParent}}"
+                                 KeyboardNavigation.DirectionalNavigation="Contained"
+                                 KeyboardNavigation.TabIndex="5"
+                                 KeyboardNavigation.TabNavigation="Local">      
+                            <ContentControl Content="{Binding UserControl}" />
+                        </Border>
                     </DataTemplate>
                 </TabControl.ContentTemplate>
             </TabControl>

+ 109 - 56
src/YSAI.Tool/MainWindowController.cs

@@ -1,4 +1,5 @@
-using System.Collections.Concurrent;
+using System;
+using System.Collections.Concurrent;
 using System.Collections.ObjectModel;
 using System.Windows.Controls;
 using System.Windows.Input;
@@ -24,7 +25,7 @@ namespace YSAI.Tool
     /// <summary>
     /// 数据源
     /// </summary>
-    public class Source : NotifyObject
+    public class TabSource : NotifyObject
     {
         /// <summary>
         /// 图标
@@ -51,17 +52,50 @@ namespace YSAI.Tool
             get => GetProperty(() => UserControl);
             set => SetProperty(() => UserControl, value);
         }
+
+        /// <summary>
+        /// 关闭当前选项卡
+        /// </summary>
+        public ICommand CloseTab
+        {
+            get => new CommandX(() =>
+            {
+                OnEventHandler(this);
+            });
+        }
+
+        public event EventHandler<TabSource> OnEvent;
+
+        /// <summary>
+        /// 信息传递
+        /// </summary>
+        protected void OnEventHandler(TabSource e)
+        {
+            OnEvent?.Invoke(null, e);
+        }
     }
 
     public class MainWindowController : NotifyObject
     {
+        public MainWindowController()
+        {
+            //设置初始语言
+            LangsHelper.SetLangs(LangsHelper.GetLangs());
+
+            if (TabControlItemsSource == null)
+            {
+                TabControlItemsSource = new ObservableCollection<TabSource>();
+            }
+            InitControl();
+        }
+
         #region 控件
         public ICommand AboutUsTool
         {
             get => new CommandX(() =>
             {
                 string name = "AboutUsTool";
-                Source source = Sources[name];
+                TabSource source = TabSources[name];
                 if (!TabControlItemsSource.Contains(source)) { TabControlItemsSource.Add(source); }
                 TabControlSelectedItem = source;
             });
@@ -71,7 +105,7 @@ namespace YSAI.Tool
             get => new CommandX(() =>
             {
                 string name = "CanTool";
-                Source source = Sources[name];
+                TabSource source = TabSources[name];
                 if (!TabControlItemsSource.Contains(source)) { TabControlItemsSource.Add(source); }
                 TabControlSelectedItem = source;
             });
@@ -81,7 +115,7 @@ namespace YSAI.Tool
             get => new CommandX(() =>
             {
                 string name = "MqttClientTool";
-                Source source = Sources[name];
+                TabSource source = TabSources[name];
                 if (!TabControlItemsSource.Contains(source)) { TabControlItemsSource.Add(source); }
                 TabControlSelectedItem = source;
             });
@@ -91,7 +125,7 @@ namespace YSAI.Tool
             get => new CommandX(() =>
             {
                 string name = "MqttServiceTool";
-                Source source = Sources[name];
+                TabSource source = TabSources[name];
                 if (!TabControlItemsSource.Contains(source)) { TabControlItemsSource.Add(source); }
                 TabControlSelectedItem = source;
             });
@@ -101,7 +135,7 @@ namespace YSAI.Tool
             get => new CommandX(() =>
             {
                 string name = "MqttWebSocketServiceTool";
-                Source source = Sources[name];
+                TabSource source = TabSources[name];
                 if (!TabControlItemsSource.Contains(source)) { TabControlItemsSource.Add(source); }
                 TabControlSelectedItem = source;
             });
@@ -111,7 +145,7 @@ namespace YSAI.Tool
             get => new CommandX(() =>
             {
                 string name = "OpcDaHttpClientTool";
-                Source source = Sources[name];
+                TabSource source = TabSources[name];
                 if (!TabControlItemsSource.Contains(source)) { TabControlItemsSource.Add(source); }
                 TabControlSelectedItem = source;
             });
@@ -121,7 +155,7 @@ namespace YSAI.Tool
             get => new CommandX(() =>
             {
                 string name = "OpcUaClientTool";
-                Source source = Sources[name];
+                TabSource source = TabSources[name];
                 if (!TabControlItemsSource.Contains(source)) { TabControlItemsSource.Add(source); }
                 TabControlSelectedItem = source;
             });
@@ -131,7 +165,7 @@ namespace YSAI.Tool
             get => new CommandX(() =>
             {
                 string name = "OpcUaServiceTool";
-                Source source = Sources[name];
+                TabSource source = TabSources[name];
                 if (!TabControlItemsSource.Contains(source)) { TabControlItemsSource.Add(source); }
                 TabControlSelectedItem = source;
             });
@@ -141,7 +175,7 @@ namespace YSAI.Tool
             get => new CommandX(() =>
             {
                 string name = "SerialPortTool";
-                Source source = Sources[name];
+                TabSource source = TabSources[name];
                 if (!TabControlItemsSource.Contains(source)) { TabControlItemsSource.Add(source); }
                 TabControlSelectedItem = source;
             });
@@ -151,7 +185,7 @@ namespace YSAI.Tool
             get => new CommandX(() =>
             {
                 string name = "SocketTcpClientTool";
-                Source source = Sources[name];
+                TabSource source = TabSources[name];
                 if (!TabControlItemsSource.Contains(source)) { TabControlItemsSource.Add(source); }
                 TabControlSelectedItem = source;
             });
@@ -161,7 +195,7 @@ namespace YSAI.Tool
             get => new CommandX(() =>
             {
                 string name = "SocketTcpServerTool";
-                Source source = Sources[name];
+                TabSource source = TabSources[name];
                 if (!TabControlItemsSource.Contains(source)) { TabControlItemsSource.Add(source); }
                 TabControlSelectedItem = source;
             });
@@ -171,7 +205,7 @@ namespace YSAI.Tool
             get => new CommandX(() =>
             {
                 string name = "SocketUdpTool";
-                Source source = Sources[name];
+                TabSource source = TabSources[name];
                 if (!TabControlItemsSource.Contains(source)) { TabControlItemsSource.Add(source); }
                 TabControlSelectedItem = source;
             });
@@ -181,121 +215,138 @@ namespace YSAI.Tool
             get => new CommandX(() =>
             {
                 string name = "SvgTool";
-                Source source = Sources[name];
+                TabSource source = TabSources[name];
                 if (!TabControlItemsSource.Contains(source)) { TabControlItemsSource.Add(source); }
                 TabControlSelectedItem = source;
             });
         }
         #endregion 控件
 
-        public MainWindowController()
+        /// <summary>
+        /// 初始化控件
+        /// </summary>
+        public void InitControl()
         {
-            //设置初始语言
-            LangsHelper.SetLangs(LangsHelper.GetLangs());
-
-            if (TabControlItemsSource == null)
-            {
-                TabControlItemsSource = new ObservableCollection<Source>();
-            }
-
-
+            #region 控件提前加载
             string name = "CanTool";
             UserControl control = new CanTool();
-            Source source = new Source { Title = name, UserControl = control };
-            Sources.AddOrUpdate(name, source, (k, v) => source);
+            TabSource source = new TabSource { Title = name, UserControl = control };
+            source.OnEvent += Source_OnEvent;
+            TabSources.AddOrUpdate(name, source, (k, v) => source);
             UserControls.AddOrUpdate(name, control, (k, v) => control);
 
             name = "MqttClientTool";
             control = new MqttClientTool();
-            source = new Source { Title = name, UserControl = control };
-            Sources.AddOrUpdate(name, source, (k, v) => source);
+            source = new TabSource { Title = name, UserControl = control };
+            source.OnEvent += Source_OnEvent;
+            TabSources.AddOrUpdate(name, source, (k, v) => source);
             UserControls.AddOrUpdate(name, control, (k, v) => control);
 
             name = "MqttServiceTool";
             control = new MqttServiceTool();
-            source = new Source { Title = name, UserControl = control };
-            Sources.AddOrUpdate(name, source, (k, v) => source);
+            source = new TabSource { Title = name, UserControl = control };
+            source.OnEvent += Source_OnEvent;
+            TabSources.AddOrUpdate(name, source, (k, v) => source);
             UserControls.AddOrUpdate(name, control, (k, v) => control);
 
             name = "MqttWebSocketServiceTool";
             control = new MqttWebSocketServiceTool();
-            source = new Source { Title = name, UserControl = control };
-            Sources.AddOrUpdate(name, source, (k, v) => source);
+            source = new TabSource { Title = name, UserControl = control };
+            source.OnEvent += Source_OnEvent;
+            TabSources.AddOrUpdate(name, source, (k, v) => source);
             UserControls.AddOrUpdate(name, control, (k, v) => control);
 
             name = "OpcDaHttpClientTool";
             control = new OpcDaHttpClientTool();
-            source = new Source { Title = name, UserControl = control };
-            Sources.AddOrUpdate(name, source, (k, v) => source);
+            source = new TabSource { Title = name, UserControl = control };
+            source.OnEvent += Source_OnEvent;
+            TabSources.AddOrUpdate(name, source, (k, v) => source);
             UserControls.AddOrUpdate(name, control, (k, v) => control);
 
             name = "OpcUaClientTool";
             control = new OpcUaClientTool();
-            source = new Source { Title = name, UserControl = control };
-            Sources.AddOrUpdate(name, source, (k, v) => source);
+            source = new TabSource { Title = name, UserControl = control };
+            source.OnEvent += Source_OnEvent;
+            TabSources.AddOrUpdate(name, source, (k, v) => source);
             UserControls.AddOrUpdate(name, control, (k, v) => control);
 
             name = "OpcUaServiceTool";
             control = new OpcUaServiceTool();
-            source = new Source { Title = name, UserControl = control };
-            Sources.AddOrUpdate(name, source, (k, v) => source);
+            source = new TabSource { Title = name, UserControl = control };
+            source.OnEvent += Source_OnEvent;
+            TabSources.AddOrUpdate(name, source, (k, v) => source);
             UserControls.AddOrUpdate(name, control, (k, v) => control);
 
             name = "SerialPortTool";
             control = new SerialPortTool();
-            source = new Source { Title = name, UserControl = control };
-            Sources.AddOrUpdate(name, source, (k, v) => source);
+            source = new TabSource { Title = name, UserControl = control };
+            source.OnEvent += Source_OnEvent;
+            TabSources.AddOrUpdate(name, source, (k, v) => source);
             UserControls.AddOrUpdate(name, control, (k, v) => control);
 
             name = "SocketTcpClientTool";
             control = new SocketTcpClientTool();
-            source = new Source { Title = name, UserControl = control };
-            Sources.AddOrUpdate(name, source, (k, v) => source);
+            source = new TabSource { Title = name, UserControl = control };
+            source.OnEvent += Source_OnEvent;
+            TabSources.AddOrUpdate(name, source, (k, v) => source);
             UserControls.AddOrUpdate(name, control, (k, v) => control);
 
             name = "SocketTcpServerTool";
             control = new SocketTcpServerTool();
-            source = new Source { Title = name, UserControl = control };
-            Sources.AddOrUpdate(name, source, (k, v) => source);
+            source = new TabSource { Title = name, UserControl = control };
+            source.OnEvent += Source_OnEvent;
+            TabSources.AddOrUpdate(name, source, (k, v) => source);
             UserControls.AddOrUpdate(name, control, (k, v) => control);
 
             name = "SocketUdpTool";
             control = new SocketUdpTool();
-            source = new Source { Title = name, UserControl = control };
-            Sources.AddOrUpdate(name, source, (k, v) => source);
+            source = new TabSource { Title = name, UserControl = control };
+            source.OnEvent += Source_OnEvent;
+            TabSources.AddOrUpdate(name, source, (k, v) => source);
             UserControls.AddOrUpdate(name, control, (k, v) => control);
 
 
             name = "SvgTool";
             control = new SvgTool();
-            source = new Source { Title = name, UserControl = control };
-            Sources.AddOrUpdate(name, source, (k, v) => source);
+            source = new TabSource { Title = name, UserControl = control };
+            source.OnEvent += Source_OnEvent;
+            TabSources.AddOrUpdate(name, source, (k, v) => source);
             UserControls.AddOrUpdate(name, control, (k, v) => control);
 
 
             name = "AboutUsTool";
             control = new AboutUsTool();
-            source = new Source { Title = name, UserControl = control };
-            Sources.AddOrUpdate(name, source, (k, v) => source);
+            source = new TabSource { Title = name, UserControl = control };
+            source.OnEvent += Source_OnEvent;
+            TabSources.AddOrUpdate(name, source, (k, v) => source);
             UserControls.AddOrUpdate(name, control, (k, v) => control);
+            #endregion
 
             if (!TabControlItemsSource.Contains(source)) { TabControlItemsSource.Add(source); }
             TabControlSelectedItem = source;
         }
 
         /// <summary>
-        /// 控件集合,提前加载
+        /// 关闭
+        /// </summary>
+        private void Source_OnEvent(object? sender, TabSource e)
+        {
+            TabControlItemsSource.Remove(e);
+        }
+
+        /// <summary>
+        /// 控件集合,提前加载,后期不移除
         /// </summary>
         private ConcurrentDictionary<string, UserControl> UserControls = new ConcurrentDictionary<string, UserControl>();
         /// <summary>
-        /// 数据源集合
+        /// 数据源集合,后期不移除
         /// </summary>
-        private ConcurrentDictionary<string, Source> Sources = new ConcurrentDictionary<string, Source>();
+        private ConcurrentDictionary<string, TabSource> TabSources = new ConcurrentDictionary<string, TabSource>();
 
         /// <summary>
         /// 选项卡控件项源
         /// </summary>
-        public ObservableCollection<Source> TabControlItemsSource
+        public ObservableCollection<TabSource> TabControlItemsSource
         {
             get => GetProperty(() => TabControlItemsSource);
             set => SetProperty(() => TabControlItemsSource, value);
@@ -303,10 +354,12 @@ namespace YSAI.Tool
         /// <summary>
         /// 选中的项
         /// </summary>
-        public Source TabControlSelectedItem
+        public TabSource TabControlSelectedItem
         {
             get => GetProperty(() => TabControlSelectedItem);
             set => SetProperty(() => TabControlSelectedItem, value);
         }
+
+
     }
 }

+ 10 - 10
src/YSAI.Ver.Manage.Tool/Program.cs

@@ -16,21 +16,21 @@ List<string> strings = new List<string>
     //"YSAI.Rpc",
     //"YSAI.Redis",
 
-    "YSAI.Kafka",
+    //"YSAI.Kafka",
     //"YSAI.Mqtt",
     //"YSAI.NetMQ",
     //"YSAI.Netty",
     //"YSAI.RabbitMQ",
 
-    //"YSAI.AllenBradley",
-    //"YSAI.Beckhoff",
-    //"YSAI.Can",
-    //"YSAI.DB",
-    //"YSAI.Mewtocol",
-    //"YSAI.Mitsubishi",
-    //"YSAI.Modbus",
-    //"YSAI.Omron",
-    //"YSAI.Opc",
+    "YSAI.AllenBradley",
+    "YSAI.Beckhoff",
+    "YSAI.Can",
+    "YSAI.DB",
+    "YSAI.Mewtocol",
+    "YSAI.Mitsubishi",
+    "YSAI.Modbus",
+    "YSAI.Omron",
+    "YSAI.Opc",
     "YSAI.Siemens",
 
 #endif