I have a Silverlight 4 ListBox with a created DataTemplate attached to it that correctly shows the items I want.
I would like to be able to have each Item in the list display differently according to a value in the object that is represented by the DataContext. I was originally looking at altering the DataTemplate on a per item basis, but I think my logic here is flawed.
What is the best way to approach开发者_开发技巧 this? Is a Listbox the best way to represent the collection given that I want a potentially different look per item?
I think ur looking for template selector in Silverlight .
Please follow below url http://www.codeproject.com/KB/silverlight/SLTemplateSelector.aspx
-Mahender
精彩评论