Drag and Drop - Need an after Drop event

SyntaxEditor for WPF Forum

Posted 8 years ago by Xinen Lee
Version: 16.1.0632

Hi Actipro,

Currently the NotifyDrop only raises a PasteDragDrop event when pasting text from another control, and before the actual insertion/replacement of text.

For my drag and drop, I need to drag and drop some (hidden) metadata associated with the text line. Hence I need the text to be inserted, before I do the Drop of the metadata (which is stored in another drag format). I can't do this in DocumentTextChanged because I would have lost the DataObject information. I can't do this in Drop because the text line has not been inserted and I can't associate the metadata with the text line.

Would it be possible to raise an event after the Drop? Will need this for drag/drop within same control as well as pasting from another control.


Comments (1)

Posted 8 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Xinen,

Unfortunately the event needs to raise first since you need to be able to set the e.Text in the drop event so that SyntaxEditor knows exactly what text will be inserted.

Could you store whatever metadata you need to pass in a static variable whenever a drag starts and then watch for DocumentTextChanged events that have a text change type of TextChangeTypes.DragAndDrop and aren't undo or redo?  Then you'd be able to process your metadata after the dropped text inserts.

Actipro Software Support

The latest build of this product (v24.1.2) was released 0 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.