I've got my own popup UI and I'm trying to adjust to the deprecations within the Popups namespace. I'm used to calling FetchAttachmentsAsync() on a PopupAttachmentManager instance, but with that class now being deprecated, it's not clear how to accomplish the equivalent. All deprecations in this part of the SDK indicate that you should use the Popup class for viewing and FeatureForm for editing. My needs are strictly view only but I'm not seeing where attachments get loaded... appreciate any pointers.
Solved! Go to Solution.
In general you should use the new PopupElements, which will also help you get the attachments:
var popup = new Mapping.Popups.Popup(feature);
await popup.EvaluateExpressionsAsync();
var attElm = popup.EvaluatedElements.OfType<Mapping.Popups.AttachmentsPopupElement>().FirstOrDefault();
Have you considered just using the PopupViewer control from the toolkit for viewing? It'll support all the formatting specified in the popup-definition, or generate a default definition is one hasn't been defined.
You can also see its entire implementation here for reference: https://github.com/Esri/arcgis-maps-sdk-dotnet-toolkit/tree/main/src/Toolkit/Toolkit/UI/Controls/Pop...
In general you should use the new PopupElements, which will also help you get the attachments:
var popup = new Mapping.Popups.Popup(feature);
await popup.EvaluateExpressionsAsync();
var attElm = popup.EvaluatedElements.OfType<Mapping.Popups.AttachmentsPopupElement>().FirstOrDefault();
Have you considered just using the PopupViewer control from the toolkit for viewing? It'll support all the formatting specified in the popup-definition, or generate a default definition is one hasn't been defined.
You can also see its entire implementation here for reference: https://github.com/Esri/arcgis-maps-sdk-dotnet-toolkit/tree/main/src/Toolkit/Toolkit/UI/Controls/Pop...
Thanks Morten. My initial goal was to just handle the deprecations in the existing code base. Then, to take a good look at the PopupViewer control to evaluate if I can switch over. I'd built my own popup UI before you all included it in the toolkit and never really looked back. Seems like it might be time to see if I can retire some of that code. Appreciate the pointers.