8
shouts

Declarative Dependency Property Definition with T4 + DTE – Colin Eberhardt’s Adventures in WPF

published 203 days, 18 hours, 45 minutes ago posted by FantasticMrFishFantasticMrFish 204 days, 12 hours, 47 minutes ago
Wednesday, August 19, 2009 5:02:04 AM GMT Tuesday, August 18, 2009 10:59:13 AM GMT

This blog post describes a technique for specifying WPF / Silverlight Dependency Properties declaritively via attributes as illustrated by the following example:

[DependencyPropertyDecl("Maximum", typeof(double), 0.0)] [DependencyPropertyDecl("Minimum", typeof(double), 0.0)]

public partial class RangeControl : UserControl

{ ... }

At design-time the declarations are read via a T4 template and the required code is generated. For more information, read on …

category: Silverlight | clicked: 48 | | source: www.scottlogic.co.uk | show counter code
tags: Dependency Property, T4, WPF