From 27770dfbfd7229cd21f84277f1bec106bfeff487 Mon Sep 17 00:00:00 2001 From: Siegfried Pammer Date: Fri, 5 Jun 2026 00:39:47 +0200 Subject: [PATCH] Add tree foreground classes + model re-filter hook for the migration Groundwork for migrating the assembly tree onto SharpTreeView: the shared item theme now binds the autoloaded / non-public foreground classes (dimmed unless the row is selected), and ILSpyTreeNode gains RefreshRealizedFilter to re-apply the API-level filter to realised nodes in place when ShowApiLevel toggles -- the TreeFlattener then drops anything newly hidden, replacing ProDataGrid's ChildrenSelector filter. --- ILSpy/Controls/TreeView/SharpTreeView.axaml | 14 ++++++++++++-- ILSpy/TreeNodes/ILSpyTreeNode.cs | 16 ++++++++++++++++ 2 files changed, 28 insertions(+), 2 deletions(-) diff --git a/ILSpy/Controls/TreeView/SharpTreeView.axaml b/ILSpy/Controls/TreeView/SharpTreeView.axaml index ae47a134d..9b78015eb 100644 --- a/ILSpy/Controls/TreeView/SharpTreeView.axaml +++ b/ILSpy/Controls/TreeView/SharpTreeView.axaml @@ -36,7 +36,7 @@ - + @@ -49,10 +49,20 @@ - + + + + diff --git a/ILSpy/TreeNodes/ILSpyTreeNode.cs b/ILSpy/TreeNodes/ILSpyTreeNode.cs index 752ab5625..97956ba37 100644 --- a/ILSpy/TreeNodes/ILSpyTreeNode.cs +++ b/ILSpy/TreeNodes/ILSpyTreeNode.cs @@ -240,5 +240,21 @@ namespace ILSpy.TreeNodes foreach (var child in Children.OfType()) ApplyFilterToChild(child); } + + /// + /// Re-applies the filter to already-realised children (without forcing lazy children to + /// load) and recurses into realised subtrees. Called when ShowApiLevel changes so the + /// visible tree updates in place -- a TreeFlattener then drops anything newly hidden. + /// + internal void RefreshRealizedFilter() + { + if (LazyLoading) + return; + foreach (var child in Children.OfType()) + { + ApplyFilterToChild(child); + child.RefreshRealizedFilter(); + } + } } }