阅读背景:

如何在WPF中使用数据绑定为列表中的每个元素创建新的用户控件?

来源:互联网 

I have a list of objects. For each item in the list, I want to create a new user control bound to that item. From what I've read, doing this programmatically is bad practice with WPF (as well as less than straightforward), so I should use data binding as a solution instead. The problem is, I can't figure out how to do this. I don't know the contents of the list (just the type) at compile-time, so I can't create and bind with XAML for each element. Google and MSDN don't seem to have any answers, so maybe I'm thinking about this the wrong way? What do I need to do?I have a list of objects. For each item in the




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: