xamarin mac app 文件拖拽

RegisterForDraggedTypes(new string[] { "NSFilenamesPboardType" });

public override void DraggingEnded(NSDraggingInfo sender)
{
   isDragIn = false;
   this.NeedsDisplay = true;
   NSMutableArray array = (Foundation.NSMutableArray)sender.GetDraggingPasteboard().GetPropertyListForType("NSFilenamesPboardType");
   string filePath = array.GetItem(0);
   Console.WriteLine(filePath);
}

你可能感兴趣的:(xamarin mac app 文件拖拽)