From ca97f3d0e902a209974ad72f6a3e3b6b16e90fd9 Mon Sep 17 00:00:00 2001 From: John Lewin Date: Tue, 22 Sep 2015 14:04:30 -0700 Subject: [PATCH] Clear SelectedItems when the LibraryDataView is rebuilt --- Library/LibraryDataView.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Library/LibraryDataView.cs b/Library/LibraryDataView.cs index 31de50863..0293b697e 100644 --- a/Library/LibraryDataView.cs +++ b/Library/LibraryDataView.cs @@ -364,15 +364,17 @@ namespace MatterHackers.MatterControl.PrintLibrary private void AddAllItems(object inData = null) { + // Clear SelectedItems when the list is rebuilt to prevent duplicate entries + this.SelectedItems.Clear(); + topToBottomItemList.RemoveAllChildren(); var provider = this.CurrentLibraryProvider; - - // Logical "up folder" button if (provider != null) { if (provider.ProviderKey != "ProviderSelectorKey") { + // Create logical "up folder" entry PrintItemCollection parent = new PrintItemCollection("..", provider.ProviderKey); LibraryRowItem queueItem = new LibraryRowItemCollection(parent, provider, -1, this, provider.ParentLibraryProvider, GetThumbnailWidget(provider.ParentLibraryProvider, parent, LibraryProvider.UpFolderImage), "Back".Localize()); queueItem.IsViewHelperItem = true;