ArcGIS Pro 3.2 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / PopupContent Class / IsDynamicContent Property
Example

In This Topic
    IsDynamicContent Property
    In This Topic
    Gets or sets a value indicating if the content for the pop-up should be created the first time it is loaded in the window.
    Syntax
    public bool IsDynamicContent {get; set;}
    Public Property IsDynamicContent As Boolean
    Remarks
    Use this option if you want to create the content for the pop-up dynamically when the item is displayed in the window. This is useful if you are going to be showing multiple items in the pop-up window and don't want to generate the content for the item until it is viewed in the window. To take advantage of this dynamic content creation you must derive from the PopupContent class and override the OnCreateHtmlContent method. This method will be called the first time the content for the item is requested.
    Example
    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