From ad1b92cd77c3c420d4b29c00bccf0a4b248b9f30 Mon Sep 17 00:00:00 2001 From: Steven Kirk Date: Sat, 3 Oct 2015 15:01:39 +0200 Subject: [PATCH] Implemented ClearContainers for TreeView. --- .../Generators/TreeItemContainerGenerator.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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(); } ///