Geeks With Blogs


Timmy Kokke's Blog

↑ Grab this Headline Animator

Timmy Kokke at Blogged
Timmy Kokke …just sorting my bubbles…


This is the first in a series of small articles about what is new in Silverlight 4 and Expression Blend 4. The series is build around a open source demo application SilverAmp which is available on


MVVM Project and Item Templates

Expression Blend has got a new project template to get started with a Model-View-ViewModel project  easily. The template provides you with a View and a ViewModel bound together. It also adds the ViewModel to the SampleData of your project. It is available for both Silverlight and Wpf.

clip_image002To get going, start a new project in Expression Blend and select Silverlight DataBound Application from the Silverlight project type. In this case I named the project DemoTest1.


The solution now contains several folders:

  • SampleData; which contains a data to show in Blend
  • ViewModels; starts with one file, MainViewModel.cs
  • Views; containing MainView.xaml with codebehind used for binding with the MainViewModel class.
  • and your regular App.xaml and MainPage.xaml

The MainViewModel class contains a sample property and a sample method. Both the property and the method are used in the MainView control. The MainView control is a regular UserControl and is placed in the MainPage.

You can continue on building your applicaition by adding your own properties and methods to the ViewModel and adding controls to the View.

Adding Views with ViewModels is very easy too. The guys at Microsoft where nice enough to add a new Item template too: a UserControl with ViewModel. If you add this new item to the root of your solution it will add the .xaml file to the views folder and a .cs file to the ViewModels folder.



The databound Application project type is a great to get your MVVM based project started. It also functions a great source of information about how to connect it all together.


Posted on Wednesday, June 16, 2010 8:29 AM Silverlight , WPF , Blend , dotnetmag | Back to top

Comments on this post: MVVM Project and Item Templates

# re: MVVM Project and Item Templates
Requesting Gravatar...
I have tried downloading this databound application before but failed. I did not know why but i guess I can have it now. Thanks for sharing! Do you have new apps? Please share more...
Left by grout cleaning on Apr 07, 2011 7:51 AM

# re: MVVM Project and Item Templates
Requesting Gravatar...
Thanks for posting this sounds realy interesting.
Left by Grout Cleaning on Jun 16, 2011 5:58 AM

# re: MVVM Project and Item Templates
Requesting Gravatar...
Interesting blog thanks for sharing.
Left by Grout Sealing on Mar 25, 2013 5:41 AM

Your comment:
 (will show your gravatar)

Copyright © Timmy Kokke | Powered by: