Silverlight 4 数据绑定与匿名类型 [英] Silverlight 4 Data Binding with anonymous types
本文介绍了Silverlight 4 数据绑定与匿名类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
有谁知道您是否可以在 Silverlight 4 中使用匿名类型的数据绑定?我知道你不能在以前版本的 Silverlight 中,你只能数据绑定到公共类属性,而匿名类型属性是内部的.
Does anyone know if you can use data binding with anonymous types in Silverlight 4? I know you can't in previous versions of silverlight, you can only databind to public class properties and anonymous type properties are internal.
只是想知道是否有人在 Silverlight 4 中尝试过?
Just wondering if anyone has tried it in silverlight 4?
推荐答案
你可以……如果你暴露你的内部结构.
You can... If you expose your internals.
将其放在您的 AssemblyInfo.cs 中:
Place this in your AssemblyInfo.cs:
[assembly: System.Runtime.CompilerServices.InternalsVisibleTo("System.Windows")]
这篇关于Silverlight 4 数据绑定与匿名类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文