This project has moved and is read-only. For the latest updates, please go here.

Best Practice Question

Jan 12, 2011 at 6:06 PM

My general question is should the View react to the ViewModel or should the ViewModel react to the View.

For example you have Display bool that is true when a dialog is displayed or false otherwise.  The dialog's IsOpen attribute is bound to this property.  Should I fire a command "GetInput" on the ViewModel which will get some data to fill a ListBox and then set Display to true, or should I set IsOpen to true which I will then watch this in the ViewModel to get the data if needed.

Should I completely devoid UI stuff from the ViewModel.  It seems to me to have a pure separation the ViewModel would have to react to what the view does through the bound properties.  Or is a 2 way communication all right?


Jan 13, 2011 at 5:09 AM

Since this is not an MVVMLight specific question u should probably post it to stackoverflow