Select to view content in your preferred language

Popup deprecations... how should I load attachments?

82
2
Jump to solution
Thursday
Labels (3)
Mike_Quetel
Frequent Contributor

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.

0 Kudos
1 Solution

Accepted Solutions
dotMorten_esri
Esri Notable Contributor

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...

 

View solution in original post

2 Replies
dotMorten_esri
Esri Notable Contributor

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...

 

Mike_Quetel
Frequent Contributor

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.

0 Kudos