I need a control to call DragMove() for a Window on MouseLeftButton down, but still function when clicked.
If DragMove() is called, Click and MouseLeftButtonUp are n
I believe my edit above is the best solution.
If you want both behaviors then you will have to trap both the mouse down and mouse move events. In the mouse down you save the current mouse location:
StartPosition = event.GetPosition(ui_element);
Then in the mouse move you only start a drag if the mouse button is still down and the mouse has moved enough:
if (e.LeftButton == MouseButtonState.Pressed) {
Point position = e.GetPosition(Scope);
if (Math.Abs(position.X - StartPoint.X) > SystemParameters.MinimumHorizontalDragDistance ||
Math.Abs(position.Y - StartPoint.Y) > SystemParameters.MinimumVerticalDragDistance) {
StartDrag(e);
}
}
The SystemParameters object defines the Windows' idea of what a move is.