ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / PopupCommand Class / Image Property
Example

In This Topic
    Image Property (PopupCommand)
    In This Topic
    Gets or sets the image for the command.
    Syntax
    public ImageSource Image {get; set;}
    Public Property Image As ImageSource
    Example
    Show A Pop-up With Custom Commands
    public void ShowCustomPopup(MapMember mapMember, long objectID)
    {
      //Get the active map view.
      var mapView = MapView.Active;
      if (mapView == null)
        return;
    
      //Create custom popup content from existing map member and object id
      var popups = new List<PopupContent>();
      popups.Add(new PopupContent(mapMember, objectID));
      
      //Create a new custom command to add to the popup window
      var commands = new List<PopupCommand>();
      commands.Add(new PopupCommand(
        p => MessageBox.Show(string.Format("Map Member: {0}, ID: {1}", p.MapMember, p.IDString)),
        p => { return p != null; },
        "My custom command",
        new BitmapImage(new Uri("pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericCheckMark16.png")) as ImageSource));
    
      mapView.ShowCustomPopup(popups, commands, true);
    }
    Show A pop-up With Custom Commands
    public void ShowCustomPopup(MapMember mapMember, long objectID)
    {
      //Get the active map view.
      var mapView = MapView.Active;
      if (mapView == null)
        return;
    
      //Create custom popup content from existing map member and object id
      var popups = new List<PopupContent>();
      popups.Add(new PopupContent(mapMember, objectID));
    
      //Create a new custom command to add to the popup window
      var commands = new List<PopupCommand>();
      commands.Add(new PopupCommand(
        p => MessageBox.Show(string.Format("Map Member: {0}, ID: {1}", p.MapMember, p.IDString)),
        p => { return p != null; },
        "My custom command",
        new BitmapImage(new Uri("pack://application:,,,/ArcGIS.Desktop.Resources;component/Images/GenericCheckMark16.png")) as ImageSource));
    
      mapView.ShowCustomPopup(popups, commands, true);
    }
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also