Thursday, 3 May 2012

Data Templates for Hetrogeneous Collections

Today, I added manuscripts to the smart search module.  This meant that my search results needed to display a representation of both contact and manuscript data in the results list.  One simple way to achieve this would be to implement a common interface that a single data template would present.  However, I wanted the flexibility of different representations for the differing data types.  The solution to this is to use the DataType property on DataTemplate to create an implicit data template.  This had the effect of applying the template to all instances of that type.

See DataType property section in this article:
http://msdn.microsoft.com/en-us/library/ms742521.aspx


No comments:

Post a Comment