Monday, June 28, 2010

Expression Blend 4: Business Application Development

Today I’ll write about support for MVVM and design-time resources. You can simplify your daily work. Read this post!

Expression Blend offers new sample data, behaviors, and project templates to support MVVM.

It includes the Silverlight/WPF Databound Application project template that offers a basic starting point for MVVM pattern applications. The UserControl with ViewModel item template is very helpful, too.

01_MVVM_0201_MVVM_03

Methods and commands of CLR objects show up just like data in the data pane. You can now bind execution of methods and commands against UI elements with drag and drop. Blend automatically generates an InvokeCommandAction or a CallMethodAction with default trigger!

01_MVVM_06 - Mod 01_MVVM_07

New Blend can generate sample data for CLR classes, even for classes that have private constructors, properties without setters and so on. If your application uses the MVVM pattern, you can generate design-time sample view models and  continue to design your application in the context of this data.

01_MVVM_08 01_MVVM_09 01_MVVM_11 01_MVVM_13 - Mod 01_MVVM_14

Modern applications are often broken into dynamically loaded modules (f.e MEF). At design time, this often leads to problems because not all required resources are available in an individual module. With Blend 4, designers can load in a temporary resource file that is only used for resource resolution at design time, enabling a great design experience even in complicated modular scenarios. When you open a project in Blend and the current document contains resources that cannot be resolved and your solution contains at least one ResourceDictionary file, the Add Design-time Resource Dictionary dialog will open.

01_MVVM_15

Below you see my sample application with all features described in this post. Runtime data is different than design-time data.

01_MVVM_17

Complete solution you can download here.

Useful links

2 comments:

江婷 said...

may the blessing be always with you!!.................................................................                           

sam said...

Heya¡­my very first comment on your site. ,I have been reading your blog for a while and thought I would completely pop in and drop a friendly note. . It is great stuff indeed. I also wanted to ask..is there a way to subscribe to your site via email?

Mobile Applications Development