ArcGIS Pro 2.8 API Reference Guide
ItemCollection Property (Gallery)

ArcGIS.Desktop.Framework.Contracts Namespace > Gallery Class : ItemCollection Property
Gets the gallery's items.
Syntax
public ReadOnlyObservableCollection<object> ItemCollection {get;}
Public ReadOnly Property ItemCollection As ReadOnlyObservableCollection(Of Object)
Remarks

The default item template for galleries expects GalleryItems. If you are using your own item template, you can fill the collection with whatever type is appropriate; in this case, if you want grouping, make sure the objects expose a public Group property of type string as the binding logic uses this.

All items added to the ItemCollection must be created on the main UI thread as these ultimately become the content of buttons added to the gallery popup control.

Do not iterate over this collection manually as it may be changing while you do so; instead, use ItemCollectionCopy which provides a copy of the collection. This is usually used to bind against.

///
Requirements

Target Platforms: Windows 10, Windows 8.1

See Also

Reference

Gallery Class
Gallery Members