views:

24

answers:

2

I'm building a WPF application which is based on the MVVM pattern.

Later on we are going to build a Silverlight application of the same type, and also a Web application.

I want to use my ViewModels in all three UI:s, so my idea was to move the vm:s to a class library, but then I lost my ICommands, is there an easy way to get around this?

How would solve this problem?

Best regards, Peter Larsson!

A: 

MVVM assumes WPF/SilverLight's binding so you would not be able to use it on a web for sure, neither it is appropriate - it would be hopeless without binding.

MVVM is nothing but MVP while you need MVC on the web.

Aliostad
Ok, lets forget about the web for a moment. For my Silverlight application, is there a way to use the same ModelView classes in separate project and still have my ICommands intact?
Peter Larsson
I believe in SilverLight 4.0 yes you can.
Aliostad