So I have drag and drop enabled for a listview but I noted that the UIelement.IsMouseOver
doesn't work during a drag and drop operation.
Source: "This is because WPF blocks all mouse actions when we doing drag drop action. You can use EventTrigger
with an animation to do this."
However, I am very curious why the drag drop action would block mouse actions. and if that is the case, how should i be testing if the mouse is over an element during a drag and drop operation
int GetIndexOfListViewItemMouseIsOver(ListView listview)
{
for (int i = 0; i < listview.Items.Count; ++i)
{
ListViewItem item = listview.ItemContainerGenerator.ContainerFromItem(listview.Items[i]) as ListViewItem;
if (item != null && item.IsMouseOver)
{
return i;
}
}
return -1;
}