Hi guys,
I am using MVVM light toolkit in my wpf application. I would like to know what is the best approach for opening a new window from an existing window. I have got this MainViewModel, which is respnsible for MainWindow of my application. Now in the MainView, on a button click, I would like to open a second window on top of it. I have got RelayCommmand binded to the button command. In the relay command method, I can create a new window object and simply call show, something like this
var view2 = new view2()
view2.Show()
but I don't think the viewmodel should be responsible for creating the new view2 object. I have read this post http://stackoverflow.com/questions/2761162/wpf-mvvm-get-parent-from-view-model where Bugnion has suggested to pass message to the view1 from the viewmodel1 and then view1 should create the new view2. But I am not sure what does he actually mean by passing the message to the view1? how should the view1 handle the message? In its code behind or what?
Regards, Nabeel