【发布时间】:2011-02-28 22:52:38
【问题描述】:
(对于本例)ListBox l 绑定到 CustomObjectCollection c。
我会调用 c 的构造函数吗?
如果 c 是通用对象怎么办?
**In XAML (1)**<ListBox Content={Binding CustomObjectCollection}/>
**In Codebehind**CustomObjectCollection<MyClass> c;**In XAML (2)**<ListBox Content={Binding CustomObjectCollection}/>
假设在c,我填充集合(动态,使用构造函数)
哪个绑定会调用构造函数?
对不起,如果不清楚,我不知道如何解释。
【问题讨论】:
-
这个问题不是很清楚。你想达到什么目的?您可以发布您的 XAML/代码隐藏吗?
标签: wpf generics data-binding collections listbox