Closed hemets closed 10 years ago
I ran into this issue as well. Apparently the dialog causes the control to never get the notification that the mouse was released. I resolved it (I think) by inserting 5 lines of code in DragDrop.DragSourcePreviewMouseMove as follows:
private static void DragSource_PreviewMouseMove(object sender, MouseEventArgs e)
{
if (m_DragInfo != null && !m_DragInProgress)
{
if (e.LeftButton == MouseButtonState.Released) // start insertion
{
m_DragInfo = null;
return;
} // end insertion
var dragStart = m_DragInfo.DragStartPosition;
This makes sure the mouse is still down before starting a drag.
Thank you very much, i will try this as soon as possible!
geetings, andi
i have a strange problem with drag&drop in listview, when i have to show a messagebox on item selection.
this can happen, when the currently selected item has unsaved properties and the user selects a new listitem without saving the changes of openend one.
after the messagebox has been closed by user interaction, drag&drop moves the new clicked item in list nearby the mouse position in window .. without a started drag&drop action.
i have no idea how to handle that, or if i do something wrong
Here a simplified example to simulate the problem:
The xaml
The code behind
And the viewmodel
you can download the full sample project to simulate the problem here: https://www.dropbox.com/s/nmtteuib4os91xf/Admin_TestApp.zip