Jan 27, 2009 at 2:31 AM
Edited Jan 27, 2009 at 2:33 AM
I have a simple DataTemplate that I use in a ListBox. I want each item in the ListBox to have a DropTargetAdvisor so I can drop an item into it. I have set break points, and in the following function if I use Mole, I can see that depObj is the correct
ListItem. However, the IDropTargetAdvisor.TargetUI that returns ALWAYS is the the last item in the list. I've also stepped through the code and confirmed that an advisor is attached for each item Am I missing something?
static IDropTargetAdvisor GetDropTargetAdvisor(DependencyObject depObj)
Jan 27, 2009 at 3:22 AM
Edited Jan 27, 2009 at 3:24 AM
I made the following change to the DragDropManager, and it resolved the issue. However, I would like to hear your thoughts on this as I'm not entirely convinced this is the correct approach.
void DropTarget_PreviewDragEnter(object sender,
(CurrentDropTargetAdvisor.TargetUI != sender
CurrentDropTargetAdvisor.TargetUI = sender as