From d37416ce3387429ee2e2c3fba561a79f1d58cb3b Mon Sep 17 00:00:00 2001 From: muqing <1966944300@qq.com> Date: Thu, 16 Jan 2025 15:23:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E9=A1=B9=E7=9B=AE=E6=94=AF?= =?UTF-8?q?=E6=8C=81=E5=88=B0=20.NET=208=EF=BC=8C=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E6=A0=87=E7=AD=BE=E8=A7=86=E5=9B=BE=E5=8A=9F=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E7=95=8C=E9=9D=A2=E5=85=83=E7=B4=A0=E7=BB=91?= =?UTF-8?q?=E5=AE=9A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- RustTools/Editor/EditorTreeView.cs | 4 ++++ RustTools/Editor/EditorWin.xaml | 3 +-- RustTools/Editor/EditorWin.xaml.cs | 4 +++- RustTools/README.md | 2 +- RustTools/RustTools.csproj | 4 +--- 5 files changed, 10 insertions(+), 7 deletions(-) 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 -