tags:

views:

43

answers:

3

This is probably overkill on the MVVM pattern but it's new to me and I'm interested to see if it is possible.

If I attach to the MouseMove event for a Window and do DragMove, I can move a bordeless window. Can I achieve this by some other method in MVVM or should I just accept adding this code to the Window's codebehind?

+2  A: 

IMHO, unless this is something that effects your data (aka the Model) then it is View code and should be in the View's code-behind and not in the Model.

Muad'Dib
+2  A: 

Personally I think any solution using MVVM would not make this code any better. Also, this is typically something that's view related and hasn't got anything to do with the data you're displaying.

W.Meints
absolutely agree with this one!
ktutnik
A: 

This is pure UI logic and doesn't belong in a ViewModel. The only reason you wouldn't want to put this in your code-behind would be for re-use and that is better solved with a custom Window derived control.

John Bowen