I have a borderless WPF main window. I'm trying to make it so that the end user can drag the window.
I've added the following to the Window's constructor:
this.MouseLeftButtonDown += delegate { DragMove(); };
The problem is, I have a dialog box that opens up with two buttons. When I click one of these buttons, I get an InvalidOperationException unhandled with the message "Can only call DragMove when the primary mouse button is down."
This poses a few questions: Why would a mousedown event in a dialog have anything to do with this? How can I do this without this exception?
Thanks!