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(); + } + } } }