diff --git a/Library/Providers/DynamicContainerLink.cs b/Library/Providers/DynamicContainerLink.cs index 5e394d928..b01289aee 100644 --- a/Library/Providers/DynamicContainerLink.cs +++ b/Library/Providers/DynamicContainerLink.cs @@ -33,13 +33,24 @@ using MatterHackers.Agg.Image; namespace MatterHackers.MatterControl.Library { + public class NewFolderItem : ILibraryItem + { + public string ID { get; } = Guid.NewGuid().ToString(); + + public string Name { get; set; } + + public bool IsProtected => false; + + public bool IsVisible => true; + } + public class DynamicContainerLink : ILibraryContainerLink, IThumbnail { public string ID { get; set; } public string Name { get; } public string Category { get; set; } public string ThumbnailKey => thumbnail.GetHashCode().ToString(); - public bool IsProtected => true; + public bool IsProtected { get; set; } = true; public bool IsReadOnly { get; set; } = false; diff --git a/Library/Widgets/PrintLibraryWidget.cs b/Library/Widgets/PrintLibraryWidget.cs index 719d5d0d8..4dfb365ee 100644 --- a/Library/Widgets/PrintLibraryWidget.cs +++ b/Library/Widgets/PrintLibraryWidget.cs @@ -312,7 +312,11 @@ namespace MatterHackers.MatterControl.PrintLibrary if (!string.IsNullOrEmpty(result.newName) && this.libraryView.ActiveContainer is ILibraryWritableContainer writableContainer) { - writableContainer.Add(new[] { new DynamicContainerLink(result.newName, null) }); + writableContainer.Add( + new[] + { + new NewFolderItem() { Name = result.newName } + }); } }); createFolderWindow.Closed += (sender2, e2) => { createFolderWindow = null; };