From 8a00383c124c4547ce57465a429051b4a27c8e06 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Sat, 16 May 2026 18:48:22 +0200 Subject: [PATCH] Dockables own their view so slot-sharing panes render their own content Without per-dockable view resolution the dock chrome caches one view per slot and reuses it for every dockable that lands there, so a second pane sharing an Alignment (Analyzer + Debug Steps both Bottom) renders the first pane's content under the second pane's tab. Each dockable instead owns its view (IDockableViewOwner) and DockableViewRecycling hands that instance back keyed by dockable identity -- there is no app-lifetime global view cache to leak every transient document tab's view subtree. Resolution runs through the single application-wide ViewLocator (its dispatch map is introduced here rather than in the later DataTemplate cleanup) so the dock never re-resolves an owned view through the template machinery on a cache hit. Assisted-by: Claude:claude-opus-4-8:Claude Code --- Directory.Packages.props | 1 + ILSpy/App.axaml | 16 +++ ILSpy/Docking/DockableViewRecycling.cs | 137 +++++++++++++++++++++++++ ILSpy/Docking/IDockableViewOwner.cs | 41 ++++++++ ILSpy/ILSpy.csproj | 1 + ILSpy/ViewLocator.cs | 57 ++++++++-- ILSpy/ViewModels/ContentTabPage.cs | 9 +- ILSpy/ViewModels/ToolPaneModel.cs | 9 +- 8 files changed, 260 insertions(+), 11 deletions(-) create mode 100644 ILSpy/Docking/DockableViewRecycling.cs create mode 100644 ILSpy/Docking/IDockableViewOwner.cs diff --git a/Directory.Packages.props b/Directory.Packages.props index 76d55e5ca..4e695f3d7 100644 --- a/Directory.Packages.props +++ b/Directory.Packages.props @@ -28,6 +28,7 @@ + diff --git a/ILSpy/App.axaml b/ILSpy/App.axaml index 79a01c1b8..0c93eef4e 100644 --- a/ILSpy/App.axaml +++ b/ILSpy/App.axaml @@ -10,11 +10,21 @@ xmlns:metaViews="using:ILSpy.Views" xmlns:vm="using:ILSpy.ViewModels" xmlns:dockTheme="using:Dock.Avalonia.Themes.Simple" + xmlns:recycling="using:Avalonia.Controls.Recycling" + xmlns:docking="using:ILSpy.Docking" xmlns:controls="using:ILSpy.Controls" RequestedThemeVariant="Default"> + + + 13 @@ -70,6 +80,12 @@ + + +