开发者

DataTemplate with button in wp7 silverlight

开发者 https://www.devze.com 2023-03-05 08:45 出处:网络
I writing wp7 silverlight app. I have a listbox with items. I want each item to have different DataTemplate. I\'m using OnContentChanged event and read the template to the ContentTemplate.

I writing wp7 silverlight app. I have a listbox with items. I want each item to have different DataTemplate. I'm using OnContentChanged event and read the template to the ContentTemplate. My problem is with buttons on the tem开发者_JS百科plate. On runtime the buttons event handler is not found, and I get exception. What can I do?


The easiest way to do this (to have different DataTemplate for each item) is to implement some kind of DataTemplateSelector.

0

精彩评论

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