views:

38

answers:

2

I'm still very new to Silverlight. I'm currently using vs2008 at work. As far as I can gather Silverlight 4 is vs2010 only. I stumbled across this article on command binding, it says that command binding is a new feature introduced in silverlight 4. Is command binding integral to MVVM in silverlight, does it make MVVM much simpler to implement?

Thanks for any help.

+1  A: 

Commanding does make MVVM much easier, but it's also very easy to provide your own reusable commanding infrastructure. Attached Behaviors give you an easy way to right up a generic way to attach a Command to events.

I while back I wrote a very generic behavior that provides three properties: Command, CommandParameter, and EventName. It then uses reflection to wire up EventName and whene that event gets thrown it calls the Command. It's a very simple solution and is actually much more flexible than the direct commands on the SL4 controls, because you can attach to any event you like.

Stephan
Also checkout http://www.galasoft.ch/mvvm/getstarted/#tutorials, EventToCommand behavior for a framework that does what Stephan suggests.
Agies
A: 

Any XAML work in VS 2008 is a non-starter. The IDE is just too slow and buggy.

Jonathan Allen
What bugs are you refering to? It is true VS2010 is faster but speed is a function of your hardware.
AnthonyWJones
This probably is easily solved by using the XML editor instead. You still get Intellisense, but it runs significantly faster.
Stephan
I regularly crash VS 2008 when I touch XAML files. Like Stephan, the only way I can keep it stable is to only edit XAML as straight XML.
Jonathan Allen