When I try to run any example with Chil Window (I put any example on Chil Window), the Drag & Drop does not work properly,
I cannot drop anywhere!
Could you check it please.
2 Answers, 1 is accepted
answered on 10 Oct 2009, 09:13 AM
Yes, the reason for this behavior is that the ChildWindow is in a Popup and popups open in a separate visual tree than the rest of the application. There is no way to enumerate or ask for the currently opened popups and therefore the DragDrop does not know about them.
The opened windows need to be manually registered. This has to be done for each DragDrop operation. A good place to do this is the DragInfo handler. Add a DragInfo handler to the root of your application and check whether the status (e.Options.Status) is DragInProgress. Then add all open windows to the e.Options.ParticipatingVisualRoots collection. The windows will be searched for drop targets in order of appearance in the collection.
If you want to have just one handler to deal with this, it is best to register it with the AddHandler method, specifying that it should handle handled events as well, the syntax for this is: