ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapView Class / ShowCustomPopup Method / ShowCustomPopup(IEnumerable<PopupContent>,IEnumerable<PopupCommand>,Boolean,PopupDefinition) Method
The content to be displayed in the pop-up.
The collection of commands to show at the bottom of the pop-up.
A value indicating if the default pop-up commands should display.
A class to set additional properties for the popup. When set to null, default values will be used.
Example

In This Topic
    ShowCustomPopup(IEnumerable<PopupContent>,IEnumerable<PopupCommand>,Boolean,PopupDefinition) Method
    In This Topic
    Show a custom pop-up. This method must be called on the UI thread.
    Syntax

    Parameters

    popupContent
    The content to be displayed in the pop-up.
    commands
    The collection of commands to show at the bottom of the pop-up.
    includeDefaultCommands
    A value indicating if the default pop-up commands should display.
    popupDef
    A class to set additional properties for the popup. When set to null, default values will be used.
    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 custom pop-up using pop-up window properties
    public void ShowCustomPopupWithWindowDef()
    {
      if (MapView.Active == 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")
            };
      // Sample code: https://github.com/ArcGIS/arcgis-pro-sdk-community-samples/blob/master/Framework/DynamicMenu/DynamicFeatureSelectionMenu.cs
      var topLeftCornerPoint = new System.Windows.Point(200, 200);
      var popupDef = new PopupDefinition()
      {
        Append = true,      // if true new record is appended to existing (if any)
        Dockable = true,    // if true popup is dockable - if false Append is not applicable
        Position = topLeftCornerPoint,  // Position of top left corner of the popup (in pixels)
        Size = new System.Windows.Size(200, 400)    // size of the popup (in pixels)
      };
      MapView.Active.ShowCustomPopup(popups, null, true, popupDef);
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also