ArcGIS Pro 3.8 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / PopupDefinition Class / Position Property
Example

In This Topic
    Position Property (PopupDefinition)
    In This Topic
    Gets or sets the screen coordinates to place the top left corner of the popup window. When set to null, a default position will be used. Only used when dockable is false or the dockable window is floating.
    Syntax
    public Nullable<Point> Position {get; set;}
    Public Property Position As Nullable(Of Point)
    Example
    Show a pop-up for a feature using pop-up window properties
    {
      if (mapView == null)
      {
        return;
      }
      // Sample code: https://github.com/ArcGIS/arcgis-pro-sdk-community-samples/blob/master/Map-Exploration/CustomIdentify/CustomIdentify.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.ShowPopup(mapMember, objectID, popupDef);
    }
    Show a custom pop-up using pop-up window properties
    {
      if (mapView == null)
      {
        return;
      }
    
      //Create custom popup content
      List<PopupContent> popups =
      [
          new("<b>This text is bold.</b>", "Custom tooltip from HTML string"),
              new(new Uri("https://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.ShowCustomPopup(popups, null, true, popupDef);
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also