View-First or ViewModel-First

Topics: Prism v4 - Silverlight 4, Prism v4 - WPF 4
Apr 4, 2012 at 8:31 AM

Hi there, let me first start by saying that I do *not* want to start a war.... Merely, I want to gather some opinion on whether Prism is considered more orientated towards View-First or ViewModel-First development, or whether they are (like God said) created equal!?

If someone knows of a good place that discusses the Pros/Cons of both in detail, that would also be very useful! At the moment myself and the other developer are not in agreement about how best to proceed, I think we should use VM-First, he V-First. Before we make a decision either way, I'd like to make sure that I know all the facts.

Is there any difference in the amount of resources available for one over the other? Is there more documentation? Samples? etc.

Developer
Apr 4, 2012 at 6:52 PM

Hi,

Based on my understanding, Prism supports both View-First and ViewModel-First approaches. Which one you should use would depend mostly of the requirements of your scenario.

As a personal opinion, I believe that Prism is more oriented to the View-First approach. This can be seen mainly when using the UI composition capabilities of Prism, as it seems that Regions, RegionBehaviors and Navigation are more oriented to work with views and their DataContexts, rather that ViewModels.

I believe that you might find some existing discussions in this forum useful that contains different opinions and valuable information about the implementation of the ViewModel-First approach. Below you can find some examples of related discussions:

Additionally, the following blog posts by David Hill might be handy too:

I hope you find this useful,

Damian Cherubini
http://blogs.southworks.net/dcherubini

Apr 5, 2012 at 9:38 AM

Thanks a great deal, that was a very helpful response.