T4 and Silverlight in Visual Studio 2008

Colin Eberhardt has a nice article on The Code Project walking through using a small textual DSL encoded in XML to define a set of dependency properties and then using that as a data source for T4 to generate all of the necessary boilerplate code.

Apart from being intrinsically cool, he's also doing this in a Silverlight project, and he includes the small amount of special sauce needed to get T4 generation working in a Silverlight project inside Visual Studio 2008.


BTW, in Visual Studio 2010, T4 in Silverlight should "just work".


Comments (2)

  1. Colin E. says:

    Hi Gareth,

    Thanks for the shout-out. Here is a direct link to the article:


    I have also extended the idea a little so that rather than using an XML file, you place attributes on the class which you want to generate code for:


    I think this declarative approach is a lot better.

    Colin E.

  2. Colin E. says:

    …. and if I bothered to look at your most recent blgo post, I would have seen that you have linked to this already 🙂


    Colin E.

Skip to main content