I have a borderless WPF window (WindowStyle="None") that can be moved by catching LeftMouseDown and then call DragMove. That works fine.
However, I want to prevent any part of the window from leaving the screen area. I catch the LocationChanged but that is called AFTER the window has already moved and thus any changes to the windows position I make in that event cause the window to jump back, which looks very unprofessional.
Is there an event I can catch that is fired BEFORE the window is actually moved. I tried MouseMove and PreviewMouseMove but they don't get fired during DragMove.
This stuff works fine with WinForms.
Does anybody have a solution for this or is this just due to the half-baked nature and state of WPF?