我有联系人电话( EntityCollection< Phone> ),我希望数据模板处理列表 - 添加删除编辑等。
有没有办法设置DataType属性DataTemplate to generic EntityCollection< Phone> ?
解决方案在一个新类中,它将子类化为通用列表而不添加任何内容。 这使得可以从XAML绑定到列表。 这里描述如下: 我可以指定XAML(预.NET 4框架)中的通用类型?
Is there a way to create a data template that handles a list of items?
I have Contact.Phones (EntityCollection<Phone>) and I want the data template to handle the list - add remove edit etc.
Is there a way to set the DataType property of the DataTemplate to generic EntityCollection<Phone>?
解决方案Wrap your generic list in a new class, which subclasses your generic list without adding anything. This makes it possible to bind to the list from XAML. This is described here: Can I specify a generic type in XAML (pre .NET 4 Framework)?
更多推荐
DataTemplate.DataType =收集和LT;实体> ;?
发布评论