diff --git a/src/Perspex.Controls/Generators/TreeItemContainerGenerator.cs b/src/Perspex.Controls/Generators/TreeItemContainerGenerator.cs index 4f35084d70..d4aad6236e 100644 --- a/src/Perspex.Controls/Generators/TreeItemContainerGenerator.cs +++ b/src/Perspex.Controls/Generators/TreeItemContainerGenerator.cs @@ -16,7 +16,7 @@ namespace Perspex.Controls.Generators /// The type of the container. public class TreeItemContainerGenerator : ITreeItemContainerGenerator where T : TreeViewItem, new() { - private readonly Dictionary _containers = new Dictionary(); + private Dictionary _containers = new Dictionary(); private readonly Subject _containersInitialized = new Subject(); @@ -102,7 +102,9 @@ namespace Perspex.Controls.Generators /// The removed controls. public IList ClearContainers() { - throw new NotImplementedException(); + var result = _containers; + _containers = new Dictionary(); + return result.Values.Cast().ToList(); } ///