Payload cast

Hello… Please help me fast on this one…
I want to convert this part shown in the image into code.

  1. Cast drag drop operation
  2. Casting a widget from payload

Remember I want to use cast( i don’t want to use create widget)