【问题标题】:How to create the "Binding" class in that code?如何在该代码中创建“绑定”类?
【发布时间】:2015-07-17 19:43:18
【问题描述】:

我需要将EntityCollection绑定到我的data-grid,我找到了解决方案here

Binding binding = new Binding();
binding.Source = colecao;
binding.Mode = BindingMode.OneWay;
dataGrid1.SetBinding(DataGrid.ItemsSourceProperty, binding);

但是我不确定Binding class 是什么以及我需要导入什么库来创建它。

【问题讨论】:

  • 它带有presentationframework.dll。查看here了解更多详情。

标签: c# class silverlight data-binding datagrid


【解决方案1】:

As per MSDN Binding Class

Binding 类提供对绑定定义的高级访问,它连接绑定目标对象(通常是 WPF 元素)和任何数据源(例如数据库、XML 文件或任何对象)的属性包含数据)。

命名空间: System.Windows.Data
程序集: PresentationFramework(在 PresentationFramework.dll 中)

Here's one good example of it

【讨论】:

  • @EugenePodskal 请阅读 OP 问题的最后一行。 MSDN 有答案
  • MSDN 有很多答案,但最好在此处发布所有相关信息 - 答案应尽可能独立。参考只是一个有用的补充。现在看起来好多了,但我还是要补充一点,Silverlight 项目中默认添加了 PresentationFramework.dll,OP 只需要适当的 using 语句。
  • @EugenePodskal 谢谢你的建议。我会处理的
猜你喜欢
  • 1970-01-01
  • 2011-01-27
  • 1970-01-01
  • 1970-01-01
  • 2017-06-28
  • 1970-01-01
  • 2018-06-26
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多