ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Framework.Contracts Namespace / Gallery Class / ItemCollection Property

In This Topic
    ItemCollection Property (Gallery)
    In This Topic
    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 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also