I've been using MVVM for the past two years and it has certainly evolved for the better since that time. As I read though the hundreds of MVVM articles and stackoverflow questions, I've noticed that there appears to be more and more articles that describe the view/viewmodel relationship and creation as ViewModel first or View first. These articles usually use IoC or DI. I'd include some links but as a new SO user I'm only limited to 1.
My favorite technique has been the use of datatemplates to create the views, and structuring the application off the the viewmodels rather than the views. I rarely see articles anymore that use this pattern.
<DataTemplate DataType="{x:Type ViewModels:DummyViewModel}">
<Views:DummyUserControl DataContext="{Binding}"/>
</DataTemplate>
Testability and decoupling seem to be the main focus of these 'non-datatemplate' V-VM creation/relationship designs and articles, and often they have to do with MEF or PRISM. Ultimately I would like to know the following:
- Is the DataTemplate view creation technique still used or recommended?
- What are the pros/cons of the view first design?
- What are the pros/cons of the viewmodel first design (with the view injected)
I realize these are loose questions which deserve loose answers.
Any good links to articles covering these topics is appreciated, provided they are not MEF/PRISM related. The more the better. (Google turns up quite a few)