diff --git a/source/Components/AvalonDock/DockingManager.cs b/source/Components/AvalonDock/DockingManager.cs index e1d46907..0811b7a5 100644 --- a/source/Components/AvalonDock/DockingManager.cs +++ b/source/Components/AvalonDock/DockingManager.cs @@ -2343,7 +2343,7 @@ private void Layout_ElementRemoved(object sender, LayoutElementEventArgs e) private void Layout_ElementAdded(object sender, LayoutElementEventArgs e) { if (_suspendLayoutItemCreation) return; - foreach (var content in Layout.Descendents().OfType()) + foreach (var content in Layout.Descendents().OfType().ToList()) { if (content is LayoutDocument) CreateDocumentLayoutItem(content as LayoutDocument);