DragMove not working with MouseUp event
-
Hi. I have a UserControl in WPF. The UserControl has a MouseLeftButtonUp event. The problem is- the Window has a this.DragMove() method in its MouseDown event which seems to interfere with the MouseLeftButtonUp event in the User Control (I need the this.DragMove() method to move the borderless window). If I call the dragmove method in the Window's MouseDown event, then if I click on the user control- the MouseLeftButtonUp event doesn't fire. But if I don't call the dragmove method- the MouseLeftButtonUp event works fine. Any ideas? Thanks!
-
Hi. I have a UserControl in WPF. The UserControl has a MouseLeftButtonUp event. The problem is- the Window has a this.DragMove() method in its MouseDown event which seems to interfere with the MouseLeftButtonUp event in the User Control (I need the this.DragMove() method to move the borderless window). If I call the dragmove method in the Window's MouseDown event, then if I click on the user control- the MouseLeftButtonUp event doesn't fire. But if I don't call the dragmove method- the MouseLeftButtonUp event works fine. Any ideas? Thanks!
Since the first days of windows event programming it has always been a heirarchy for event processing that the form first, container second, contained controls next, controls in a container in the contained controls last.... The only way you can get away from that is not going to be clean. On MouseEnter on your control, remove the DragMove event handler binding and put your mouse click event on. On MouseLeave on your control, remove the left button event handler and put DragMove back on.