From aa1896f4b0ef600b15323b4ac534ec25e3c5080b Mon Sep 17 00:00:00 2001 From: h3xds1nz Date: Thu, 2 Jan 2025 17:03:33 +0100 Subject: [PATCH] Replace ArrayList in ItemContainerGenerator with List (#9432) * replace ArrayList in ItemContainerGenerator with List * use fully qualified type when initializing a new instance --- .../System/Windows/Controls/ItemContainerGenerator.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/ItemContainerGenerator.cs b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/ItemContainerGenerator.cs index 2d694e0e512..00671ad061b 100644 --- a/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/ItemContainerGenerator.cs +++ b/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Controls/ItemContainerGenerator.cs @@ -2055,7 +2055,8 @@ void AddEmptyGroupItem(CollectionViewGroup group) // add it to the list of placeholder items (this keeps it from being GC'd) if (_emptyGroupItems == null) - _emptyGroupItems = new ArrayList(); + _emptyGroupItems = new List(); + _emptyGroupItems.Add(emptyGroupItem); } @@ -2792,7 +2793,7 @@ void OnRefresh() private ReadOnlyCollection _itemsReadOnly; private GroupStyle _groupStyle; private ItemContainerGenerator _parent; - private ArrayList _emptyGroupItems; + private List _emptyGroupItems; private int _alternationCount; private Type _containerType; // type of containers on the recycle queue