AnsweredAssumed Answered

How do you add existing controls to a Gallery?

Question asked by kory.karr_NCS on Aug 8, 2019
Latest reply on Aug 8, 2019 by UHarano-esristaff

I was watching an Esri video from this year's DevSummit presented by Uma Harano It demonstrates how to add controls to a gallery in a ribbon. I'm unclear on how to actually add controls (e.g. buttons) to a Gallery. In the video, Uma adds a custom class, AcmeGalleryItem, which is constructed from ComponentElements.  Is the code for AcmeGalleryItem available? It doesn't seem trivial. 

I also looked at the Pro Guide for Galleries, and it says:


The actual contents of a gallery are normally populated at runtime. Gallery items are modeled through the GalleryItem class. GalleryItems have the following properties: Icon or imagePath, Text, Group, and Tooltip. Custom GalleryItems can be created through inheritance to encapsulate any additional properties and/or behavior as needed.

From this it seems the GalleryItems are pretty simplistic. I would imagine that Uma's AcmeGalleryItem holds the actual button as a member variable, but I'm not sure how to instantiate a control defined in DAML. It at least needs to be able to get the icon, name and tooltip;  and hopefully pass through events like click, mouseover, etc. Again, it seems a lot of magic happens in AcmeGalleryItem.