Caliburn 1.1 on Windows Phone 7

I’ve always enjoyed working with the Caliburn framework for WPF and Silverlight, having the view and view model wired with so many conventions makes creating a rich view model really easy. So one of the first things I did after getting a hold of the Windows Phone 7 CTP was to try and get Caliburn working.

Using JQuery to embed Silverlight

Embeding Silverlight xaps in a page can be a pain in the ass, it’s very verbose if you try and do it manually. I’m already using JQuery on the Compiled Experience Website so anything where I can use JQuery to simply this would be great.

Unit of Work per Action

Most of the time I do any database interaction I follow a “Unit of Work” pattern. This allows good control over when work is submitted to the database, in terms of the Entity Framework, the Unit of Work controls the lifetime of the ObjectContext.

Entity Framework Repositories

A long time ago I wrote a few posts about using “Domain Driven Design”-esque repositories using Linq to SQL (“Domain Driven Design Repositories in Linq to SQL”). I still use that general pattern with a few tweaks with extra layer of a “Unit of Work” to manage context lifetimes. I’m using this rebuild as a chance to play with Entity Framework 4 and so need to implement the appropriate interfaces all over again. The only major functionality change will be bringing in support for Entity Frameworks “Include”.

Gothcha when creating your own Client Side Data Annotation Validators

For the new version of the website I'm using the Data Annotations validators for validating view models posted to the controllers. As I'm sure everyone who starts down this road does one of the first things I wanted to create was an EmailAttribute by extending RegularExpressionAttribute. The mighty Scott Gu goes through this process in his blog post on [Model Validation](http://weblogs.asp.net/scottgu/archive/2010/01/15/asp-net-mvc-2-model-validation.aspx).