DataType property of DataTemplate in Silverlight

Topics: Prism v2 - Silverlight 2
Mar 18, 2009 at 1:29 PM
Edited Mar 18, 2009 at 1:37 PM

Can i do DataType property of DataTemplate (like in WPF) in Silverlight with Prism or anyone known another way to realize it?

I dont like "hardcoding" ways like this need more flexible.

Mar 18, 2009 at 6:22 PM

Hi Butaji,


Unfortunately Silverlight 2.0 does not support DataType properties in DataTemplates so there is no other way but to do this in code. In future versions more and more features will be added.


I’m not sure if it applies in your scenario, but the Silverlight toolkit gives you a way to set implicit styles for Controls (although no DataTemplates), emulating what WPF does. See some examples here: Silverlight Toolkit Overview, Part 3 - Theming


Matias Bonaventura


Apr 8, 2009 at 6:47 AM
Made a small change to my template, see