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".

 

Published 25 September 09 06:32 by GarethJ

Comments

# Colin E. said on September 28, 2009 3:11 AM:

Hi Gareth,

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

http://www.codeproject.com/KB/WPF/DependencyPropertyCodeGen.aspx

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:

http://www.scottlogic.co.uk/blog/wpf/2009/08/declarative-dependency-property-definition-with-t4-dte/

I think this declarative approach is a lot better.

Colin E.

# Colin E. said on September 28, 2009 3:13 AM:

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

Thanks,

Colin E.

New Comments to this post are disabled

Search

This Blog

Disclaimer
The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Inappropriate comments will be deleted at the authors discretion.
All code samples are provided "AS IS" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

Tags

Archives

Architects who Model

DSL Tools Team

Links

Syndication

Page view tracker