ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapTool Class / OverlayControlPositionRatio Property
Example

In This Topic
    OverlayControlPositionRatio Property
    In This Topic
    Gets or sets the position of the embeddable control on the map view as a ratio.
    Syntax
    protected Point OverlayControlPositionRatio {get; set;}
    Protected Property OverlayControlPositionRatio As Point
    Example
    How to position an embeddable control inside a MapView
    public ProSnippetMapTool()
    {
      //Set the MapTool base class' OverlayControlID to the DAML id of your embeddable control in the constructor
      this.OverlayControlID = "ProAppModule1_EmbeddableControl1";
    }
    
    protected override void OnToolMouseDown(MapViewMouseButtonEventArgs e)
    {
      if (e.ChangedButton == System.Windows.Input.MouseButton.Left)
        e.Handled = true;
    }
    
    protected override Task HandleMouseDownAsync(MapViewMouseButtonEventArgs e)
    {
      return QueuedTask.Run(() =>
      {
        //assign the screen coordinate clicked point to the MapTool base class' OverlayControlLocation property.
        this.OverlayControlPositionRatio = e.ClientPoint;
    
      });
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also