Visual studio feeds

All Visual Studio blogs in one place

Subscribe

Enter your email address:

Delivered by FeedBurner

Increase your website traffic with Attracta.com

Google+

Contact

Email:
Subject:
Message:
Anti-spam: How many eyes has a typical person?

Follow us on FB

Search

Hierarchical binding with Implicit Data Templates

AddThis Social Bookmark Button
Implicit data templates are a new interesting feature of Silverlight 5.0. They are a new way to create templates that automatically applies to specific types. So, imagine you have a set of types defined, and you want to present a collection of them inside an ItemsControl, you can use an Implicit Template that apply to each one of the types you are binding. Automatically this template will be applied to the give type every time it appear in the collection. As you can figure out if may become really useful to present every item in a different
way. Let say you have an Event base class and two derived Alarm and Information. You can bind the ItemsControl to an ObservableCollection as usual. Then you specify a different template for each one of the derived types:
Home : Blog List : Silverlight Playground : Hierarchical binding with Implicit Data Templates