wpf - 有没有人有在 MVVM 模式下工作的 WPF Datagrid 的代码示例?

标签 wpf data-binding datagrid mvvm

我得到了以下 WPF DataGrid 的示例绑定(bind)到 MVVM 模式中的 ViewModel,但它是只读的:

MVVM example which has buttons that switch the data in the ViewModel

我试图扩展它,以便将 DataGrid 绑定(bind)到 ViewModel 的可观察集合,以便编辑单元格会在适当的 ViewModel 上触发 OnPropertyChanged 事件,但无法让它按我想要的方式工作。

有谁知道这样做的代码示例,即 不将 DataGrid 绑定(bind)到具有 OnPropertyChanged 属性和委托(delegate)命令的 ViewModel 集合 , ETC。?

最佳答案

Jaime Rodriguez 和 Karl Schifflett 正在进行 MVVM 培训路演。他们开发了一个演示应用程序(使用数据网格),也许您想查看该应用程序以及文档......

http://blogs.msdn.com/jaimer/archive/2009/02/10/m-v-vm-training-day-sample-application-and-decks.aspx

关于wpf - 有没有人有在 MVVM 模式下工作的 WPF Datagrid 的代码示例?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/943618/

相关文章:

wpf 控件宽度绑定(bind)

c# - 无法绑定(bind) contentPresenter 的内容

c# - 数据绑定(bind)到 WP8 工具包 ExpanderView

WPF 绑定(bind)到 DataGridTemplateColumn 中的组合框

c# - 将 DataTable 绑定(bind)到 DataGrid - 不管怎样,前两列都是空的

wpf - 为什么 WPF 中的许多属性都是 'Object' 而不是接口(interface)?

c# - LiveCharts 标记距离鼠标最近的点

wpf - 当命令 CanExecute 为 false 时,按钮不会被禁用

android - View :null 上的 View 标记不正确

c# - 合并 DataGrid 列标题