diff --git a/RustTools/Editor/EditorTreeView.cs b/RustTools/Editor/EditorTreeView.cs index 45119ef..ae2dee6 100644 --- a/RustTools/Editor/EditorTreeView.cs +++ b/RustTools/Editor/EditorTreeView.cs @@ -46,6 +46,10 @@ public class EditorTreeView : TreeView else { Debug.WriteLine($"File clicked: {invokedItem.Name}"); + EditorWin.TabViewList.Add(new TabViewItem() + { + Header = invokedItem.Name, + }); } } } diff --git a/RustTools/Editor/EditorWin.xaml b/RustTools/Editor/EditorWin.xaml index 65135f3..8960e67 100644 --- a/RustTools/Editor/EditorWin.xaml +++ b/RustTools/Editor/EditorWin.xaml @@ -110,8 +110,7 @@ x:Name="tabview" Grid.Row="0" Height="auto" - IsAddTabButtonVisible="False" - TabItemsSource="{x:Bind TabViewList}" /> + IsAddTabButtonVisible="False" /> diff --git a/RustTools/Editor/EditorWin.xaml.cs b/RustTools/Editor/EditorWin.xaml.cs index edb38f5..b56e913 100644 --- a/RustTools/Editor/EditorWin.xaml.cs +++ b/RustTools/Editor/EditorWin.xaml.cs @@ -12,7 +12,7 @@ namespace RustTools.Editor; /// public sealed partial class EditorWin : WindowEx { - private readonly ObservableCollection TabViewList = new(); + public static ObservableCollection TabViewList = new(); //Ŀ¼б public ObservableCollection DataSource = new(); @@ -39,6 +39,8 @@ public sealed partial class EditorWin : WindowEx DataSource = EditorLoad.GetData(directoryInfo.FullName); treeView.ItemsSource = DataSource; Closed += EditorWin_Closed; + tabview.TabItemsSource = TabViewList; + } diff --git a/RustTools/README.md b/RustTools/README.md index bd3b5d6..4a0aa6a 100644 --- a/RustTools/README.md +++ b/RustTools/README.md @@ -1,7 +1,7 @@  ## 开始使用 Windows10系统版本以上 - net7.0-windows10.0.19041.0的支持 + net8.0-windows10.0.19041.0的支持 Visual Studio Code Visual Studio JetBrains Rider diff --git a/RustTools/RustTools.csproj b/RustTools/RustTools.csproj index 29bf369..4c50e71 100644 --- a/RustTools/RustTools.csproj +++ b/RustTools/RustTools.csproj @@ -1,14 +1,13 @@  WinExe - net7.0-windows10.0.19041.0 + net8.0-windows10.0.19041.0 10.0.17763.0 RustTools x64 x86;x64;arm64 true true - win10-x86;win10-x64;win10-arm64 enable enable true @@ -19,7 +18,6 @@ Assets\WindowIcon.ico README.md zh-cn -