USING MVVM FRAMEWORKS

One of the benefits of using an MVVM architecture is that a lot of your code is more reusable, enabling you to build more features faster. Sometimes, you end up reusing the same framework code (for example, the ButtonCommandHelper and DelegateCommand classes you saw earlier in this chapter) across completely different projects. Other developers have noticed this, too, and some have gone as far as extracting the reusable bits of code into a formal framework.

It's a good idea to use an existing third-party MVVM framework for any big projects because the implementations have been thoroughly tested and cover more ground than the samples you've seen in this chapter. For example, a fully featured implementation of ButtonCommandHelper would also disable the associated button whenever the command was not executable, and it would allow you to pass parameters from data bindings into the command. There' s nothing stopping you from adding this functionality to your own classes; it's simply easier to use other people' s work.

image NOTE All the current MVVM frameworks are open source, donated to the world by their original developers, so you should be able to just download the latest assemblies from the Internet and use them directly. Although you shouldn't ever have to pay for these open source frameworks, it's always worth remembering to read the license in case the terms ...

Get Beginning Windows® Phone 7 Application Development: Building Windows® Phone Applications Using Silverlight® and XNA® now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.