ArcGIS Pro 2.6 API Reference Guide
OnDrop Method (PaneBase)
Example 

ArcGIS.Desktop.Framework.Contracts Namespace > PaneBase Class : OnDrop Method
The data being dropped.
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 10, Windows 8.1, Windows 7

See Also

Reference

PaneBase Class
PaneBase Members
OnDragOver Method