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.
- Create new Windows Phone 8 basic project
- Install Caliburn.Micro.Start nuget package
- Create new folder into your project "Views"
- Create new folder into your project "ViewModels"
- Drag MainPage.xaml and MainPageViewModel.cs to their folders
- Change Navigation Page from WMAppManifest.xml to "Views/MainPage.xaml"
- Remove everything else than InitializeComponent() from app.xaml.cs
- Edit your app.xaml
- Prepare your first viewmodel
- Clean MainPage.xaml.cs
- 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.