Reputation: 1309
i'm working with WPF for quite some time now. the platform i used is MVVM Light. and i must say i don't add a single line of code in the code-behind files.
lately i dived into Prism, and i see many many examples where code-behind (such as data context, or property change events) is a matter of course.
is Prism considered as pure mvvm platform ?
although the implementation of IoC this still break the rules of mvvm:
[Import]
public MainViewModel ViewModel
{
set { DataContext = value; }
}
Upvotes: 1
Views: 211
Reputation: 3839
Prism is a framework to build complex, composite applications which base on recommended practicies from Microsoft. MVVM is one those practice, the other one is modularity of application. That's why you can see an applicaiton which uses Prism but not follows MVVM - it just has modularity structure and uses Prism to lazy module downloading, declarative module including etc.
But Prism is excellent MVVM framework itself. It provides implementation of base MVVM patterns:
Prism as MVVM framework is heavy for small application, but it's very powerfull and extendable and I saw good composite MVVM-designed applications which was created using Prism.
Upvotes: 1
Reputation: 5224
Prism
is a facilitator of MVVM
, not a platform. It's the role of the developer to follow the principals of MVVM
. I suspect there are many Prism apps that don't follow the principals of MVVM
. I've even worked on one.
Upvotes: 0
Reputation: 7573
No, Prism is a Composite Application platform (if platform is the correct name, probably Library is better).
The fact that you want to use MVVM has nothing to do with Prism itself. You can use MVVM and Prism together.
Upvotes: 1