Combining DataTemplates at runtime

前端 未结 2 867
遇见更好的自我
遇见更好的自我 2020-12-04 03:54

I have a ListBox that presents a databound list of objects via its ItemSource. Because each object has special display needs I’m defining an ItemTemplateSelector that return

2条回答
  •  臣服心动
    2020-12-04 04:37

    You could create a new CustomControl that fits your needs. It will apply the style by itself and you can give additional DepdendencyProperties to make it more convinient. In the end you can still put it in a DataTemplate to use it with your DataTemplateSelector.

提交回复
热议问题