开发者

Silverlight ListBox DataTemplate

开发者 https://www.devze.com 2023-01-24 01:54 出处:网络
I have a Silverlight 4 ListBox with a created DataTemplate attached to it that correctly shows the items I want.

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

0

精彩评论

暂无评论...
验证码 换一张
取 消