ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapView Class / ShowCustomPopup Method / ShowCustomPopup(IEnumerable<PopupContent>) Method
The content to be displayed in the pop-up.
Example Version

ShowCustomPopup(IEnumerable<PopupContent>) Method
Show a custom pop-up. This method must be called on the UI thread.
Syntax
public void ShowCustomPopup( 
   IEnumerable<PopupContent> popupContent
)

Parameters

popupContent
The content to be displayed in the pop-up.
Exceptions
ExceptionDescription
Popups must be created on the UI thread
Example
Show a custom pop-up
public void ShowCustomPopup()
{
  //Get the active map view.
  var mapView = MapView.Active;
  if (mapView == null)
    return;

  //Create custom popup content
  var popups = new List<PopupContent>
        {
            new PopupContent("<b>This text is bold.</b>", "Custom tooltip from HTML string"),
            new PopupContent(new Uri("http://www.esri.com/"), "Custom tooltip from Uri")
        };
  mapView.ShowCustomPopup(popups);
}
Show A Dynamic Pop-up
public void ShowDynamicPopup(MapMember mapMember, List<long> objectIDs)
{
  //Get the active map view.
  var mapView = MapView.Active;
  if (mapView == null)
    return;

  //Create popup whose content is created the first time the item is requested.
  var popups = new List<PopupContent>();
  foreach (var id in objectIDs)
  {
    popups.Add(new DynamicPopupContent(mapMember, id));
  }

  mapView.ShowCustomPopup(popups);
}

internal class DynamicPopupContent : PopupContent
{
  public DynamicPopupContent(MapMember mapMember, long objectID)
  {
    MapMember = mapMember;
    IDString = objectID.ToString();
    IsDynamicContent = true;
  }

  //Called when the pop-up is loaded in the window.
  protected override Task<string> OnCreateHtmlContent()
  {
    return QueuedTask.Run(() => string.Format("<b>Map Member: {0}, ID: {1}</b>", MapMember, IDString));
  }
}
Requirements

Target Platforms: Windows 11, Windows 10

ArcGIS Pro version: 3 or higher.
See Also