【问题标题】:Does anyone have code examples of the WPF Datagrid working in a MVVM pattern?有没有人有在 MVVM 模式下工作的 WPF Datagrid 的代码示例?
【发布时间】:2010-10-30 22:14:20
【问题描述】:

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

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

我尝试对其进行扩展,以便将 DataGrid 绑定到一个 可观察的 ViewModel 集合,以便编辑单元格会在相应的 ViewModel 上触发 OnPropertyChanged 事件,但无法让它按照我的方式工作想要。

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

【问题讨论】:

    标签: wpf data-binding datagrid mvvm


    【解决方案1】:

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

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

    【讨论】:

      猜你喜欢
      • 2010-10-03
      • 2016-02-12
      • 1970-01-01
      • 2010-12-17
      • 1970-01-01
      • 2011-03-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多