From 344f6111d8031223b8cc53ffc090aa75250fafae Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 18 Apr 2026 16:33:15 +0800 Subject: [PATCH 1/5] =?UTF-8?q?refactor:=20=E6=9B=B4=E6=94=B9=E4=B8=BA?= =?UTF-8?q?=E5=BC=82=E6=AD=A5=E9=87=8A=E6=94=BE=E8=B5=84=E6=BA=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/DockViewV2.razor.cs | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs index 84a0bcce..337680a2 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs @@ -12,7 +12,7 @@ namespace BootstrapBlazor.Components; /// DockViewV2 组件 /// DockViewV2 component /// -public partial class DockViewV2 : IDisposable +public partial class DockViewV2 { /// /// 获得/设置 DockView 名称,默认为 null,用于本地存储标识 @@ -413,20 +413,15 @@ internal void UpdateComponentState(string? key, bool visible, bool? isLock) return state; } - private void Dispose(bool disposing) - { - if (disposing) - { - ThemeProviderService.ThemeChangedAsync -= OnThemeChangedAsync; - } - } - /// /// /// - public void Dispose() + /// + /// + protected override ValueTask DisposeAsync(bool disposing) { - Dispose(true); - GC.SuppressFinalize(this); + ThemeProviderService.ThemeChangedAsync -= OnThemeChangedAsync; + + return base.DisposeAsync(disposing); } } From 2e4a3278fe2bd8a8b3f71ac2df98e9ba0e3eb4b8 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 18 Apr 2026 16:54:05 +0800 Subject: [PATCH 2/5] =?UTF-8?q?refactor:=20DockViewTitleBar=20=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0=E9=94=80=E6=AF=81=E6=9C=BA=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/DockViewTitleBar.razor.cs | 27 ++++++++++++++++++- 1 file changed, 26 insertions(+), 1 deletion(-) diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewTitleBar.razor.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewTitleBar.razor.cs index a0f1c9a0..a774e7f8 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewTitleBar.razor.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewTitleBar.razor.cs @@ -10,7 +10,7 @@ namespace BootstrapBlazor.Components; /// DockView 标题栏组件 /// DockView title bar component /// -public partial class DockViewTitleBar +public partial class DockViewTitleBar : IAsyncDisposable { /// /// 获得/设置 标题前置图标点击回调方法,默认为 null @@ -40,4 +40,29 @@ private async Task OnClickBar() await OnClickBarCallback(); } } + + /// + /// + /// + /// + /// + protected virtual ValueTask DisposeAsync(bool disposing) + { + if (disposing) + { + OnClickBarCallback = null; + } + + return ValueTask.CompletedTask; + } + + /// + /// + /// + /// + public async ValueTask DisposeAsync() + { + await DisposeAsync(true); + GC.SuppressFinalize(this); + } } From 967f46fe75faa6e137d583bfe881965c97a6be43 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sat, 18 Apr 2026 17:09:35 +0800 Subject: [PATCH 3/5] =?UTF-8?q?refactor:=20=E5=A2=9E=E5=8A=A0=20OnClickTit?= =?UTF-8?q?leBarCallback=20=E9=87=8A=E6=94=BE=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Components/DockViewComponent.razor.cs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.razor.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.razor.cs index 663459a8..de5a128e 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.razor.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewComponent.razor.cs @@ -200,6 +200,11 @@ protected override void Dispose(bool disposing) { base.Dispose(disposing); + if (OnClickTitleBarCallback != null) + { + OnClickTitleBarCallback = null; + } + DockView.RemoveComponentState(Key); } } From 85a26c28efe69b07692190739055a950e3761ac8 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 19 Apr 2026 09:48:35 +0800 Subject: [PATCH 4/5] =?UTF-8?q?refactor:=20=E5=A2=9E=E5=8A=A0=20disposing?= =?UTF-8?q?=20=E5=8F=82=E6=95=B0=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../BootstrapBlazor.DockView/Components/DockViewV2.razor.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs index 337680a2..b00fb337 100644 --- a/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs +++ b/src/components/BootstrapBlazor.DockView/Components/DockViewV2.razor.cs @@ -420,7 +420,10 @@ internal void UpdateComponentState(string? key, bool visible, bool? isLock) /// protected override ValueTask DisposeAsync(bool disposing) { - ThemeProviderService.ThemeChangedAsync -= OnThemeChangedAsync; + if (disposing) + { + ThemeProviderService.ThemeChangedAsync -= OnThemeChangedAsync; + } return base.DisposeAsync(disposing); } From fce3d3c4ca4dc1cc8ece4010fac70972c3083c55 Mon Sep 17 00:00:00 2001 From: Argo Zhang Date: Sun, 19 Apr 2026 09:49:50 +0800 Subject: [PATCH 5/5] chore: bump version 10.0.8-beta06 --- .../BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj b/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj index b3fe2dd0..64ec313b 100644 --- a/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj +++ b/src/components/BootstrapBlazor.DockView/BootstrapBlazor.DockView.csproj @@ -1,7 +1,7 @@  - 10.0.8-beta05 + 10.0.8-beta06