ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Framework.Contracts Namespace / PaneBase Class / OnDrop Method
The data being dropped.
Example

In This Topic
    OnDrop Method (PaneBase)
    In This Topic
    Invoked when an object is dropped onto the pane. Implement this method to add class handling for this event.
    Syntax
    public virtual void OnDrop( 
       DropInfo dropInfo
    )
    Public Overridable Sub OnDrop( _
       ByVal dropInfo As DropInfo _
    ) 

    Parameters

    dropInfo
    The data being dropped.
    Remarks

    Panes and DockPanes that have registered themselves as drop targets (DAML isDropTarget) and have set DropInfo.Effects appropriately in OnDragOver, are automatically called by the framework whenever an object is dropped on them.

    public override void OnDrop(ArcGIS.Desktop.Framework.DragDrop.DropData dropData) { foreach (var item in dropData.Items) { if (System.IO.Path.GetExtension(item.Data as string) == ".txt") { item.Handled = true; ReadTextFile(item.Data as string); return; } } }
    Example
    public override void OnDrop(ArcGIS.Desktop.Framework.DragDrop.DropData dropData)
    {
      foreach (var item in dropData.Items)
      {
        if (System.IO.Path.GetExtension(item.Data as string) == ".txt")
        {
          item.Handled = true;
          ReadTextFile(item.Data as string);
          return;
        }
      }
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also