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