Inside the ListBoxItem is an object which is listening to mouse events for detecting double click so I will investigate that and report back but I just wanted to post this in case anyone else is noticing the same thing.
Comments: ** Comment from web user: 70sCommander **
__Hello Community,__
the workaround provided by __bigfootsoft__ fixed our problem without using timers! (which are always no solution to the problem!)
Here is the code:
```
using System.Windows.Input;
using Microsoft.Windows;
namespace XYZ.Controls.TreeView
{
using Nodes;
using XYZ.Nodes;
using XYZ.Nodes.StaticNodes.AnchorNodes;
using System.Windows.Controls;
public class XYZTreeViewDragDropTarget : TreeViewDragDropTarget
{
private bool leftButtonUp = false;
private bool hasQueriedContinueDrag;
private bool cancelDrag;
public XYZTreeViewDragDropTarget()
{
AddHandler(MouseLeftButtonUpEvent, new MouseButtonEventHandler(HandleMouseLeftButtonUp), true);
AddHandler(MouseLeftButtonDownEvent, new MouseButtonEventHandler(HandleMouseLeftButtonDown), true);
}
private void HandleMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
{
hasQueriedContinueDrag = false;
cancelDrag = false;
base.OnMouseLeftButtonDown(e);
}
private void HandleMouseLeftButtonUp(object sender, MouseButtonEventArgs e)
{
if (!hasQueriedContinueDrag)
cancelDrag = true;
base.OnMouseLeftButtonUp(e);
}
protected override void OnQueryContinueDrag(QueryContinueDragEventArgs args)
{
hasQueriedContinueDrag = true;
if (cancelDrag)
{
args.Action = DragAction.Cancel;
args.Handled = true;
}
base.OnQueryContinueDrag(args);
}
}
}
```