In our application, we place a small WPF list inside the Element node, we implement drag and drop using the PreviewMouseDown event ...
private void Border_PreviewMouseMove(object sender, MouseEventArgs e)
{
Point mousePos = e.GetPosition(null);
Vector diff = startPoint - mousePos;
if (e.LeftButton == MouseButtonState.Pressed &&
Math.Abs(diff.X) > SystemParameters.MinimumHorizontalDragDistance &&
Math.Abs(diff.Y) > SystemParameters.MinimumVerticalDragDistance)
{
OnDragStarted(e);
}
}
The problem we see is that when I drag and drop an item quickly and quickly, the WPF control fires only one PreviewMouseMove event before the mouse leaves Elementhost, so the drag operation does not start until the mouse returns to Elementhost and one more PreviewMouseMove event.
Is there a reliable way to handle this case?
source
share