Teemu Tapanila bio photo

Teemu Tapanila

Microsoft Azure MVP and Windows Phone developer

Email Twitter Facebook Google+ LinkedIn Github Stackoverflow

I love Model View ViewModel (MVVM) pattern when doing Windows Phone or Windows 8 development. It allows nice separation of UI and code which gives your project very good structure. There’s basically two common MVVM toolkits out which are MVVM Light and Caliburn Micro.

I first used MVVM light heavily but have recently moved over into Caliburn Micro. Biggest difference is that caliburn uses naming convention while mvvm light doesn’t. Using naming conventions makes you fast but it also raises the barrier if someone not familiar with the pattern is looking at your code.

Considering the facts I do recommend using Caliburn Micro and here’s sample how to get started and Build Windows Phone 8 hello world with Caliburn Micro.

  1. Create new Windows Phone 8 basic project
  2. Install Caliburn.Micro.Start nuget package
  3. Create new folder into your project "Views"
  4. Create new folder into your project "ViewModels"
  5. Drag MainPage.xaml and MainPageViewModel.cs to their folders
  6. Change Navigation Page from WMAppManifest.xml to "Views/MainPage.xaml"
  7. Remove everything else than InitializeComponent() from app.xaml.cs
  8. Edit your app.xaml
  9. Prepare your first viewmodel
  10. Clean MainPage.xaml.cs
  11. Enjoy your end results

If you have any questions regarding how to use Caliburn Micro with Windows Phone 8 or Windows 8 please do so on comments. Whole solution can be found here.