EntityList / EntityCollection - MVVM 示例
我正在使用 April 工具包中的新 EntityList 来公开 ViewModel 中的集合。我还将 FK 公开为 EntityCollections。
我想我会将集合公开为 IEnumerable,它使用通用接口处理集合的公开。这就留下了我绑定到网格/列表的 FK ....我可以使用 EntityCollection 创建带有嵌入对象的可枚举吗?这是“正确”的方式吗?
我还构建了许多用户控件,每个控件都有自己的视图模型。这是否意味着页面应该有一个视图模型,并在其中聚合其他视图模型?每个控件是否应该独立存在,当用户控件嵌入到页面中时实例化它自己的视图模型?
我知道我也可以跳到 POCO 课程,但我的截止日期很紧,并且希望最大限度地减少所有管道代码。
我也是测试代码的新手,但我希望当我有更多时间时,我可以回去填写。
要学的东西太多了,时间太少了!
提前致谢...
I'm working with the new EntityList in the April toolkit to expose a collection in a ViewModel. I also have FK exposed as EntityCollections.
I thought I would expose the collection as IEnumerable, which handles the exposure of a collection using generic interfaces. That leaves the FK that I bind to grids/list .... can I create an enumerable with an embeded object using EntityCollection? Is this the "right" way?
I've also built a number of user controls, each with their own viewmodel. Does this mean the page should have a viewmodel, with the other viewmodels aggregated within it? Should each control stand on it's own, instanciating it's own viewmodel when the user control is embedded in a page?
I know that I could also jump over to POCO classes, but I'm on a tight deadline, and would like to minimize all the plumbing code.
I'm also a newbie on testing code, but I'm hoping that when I have more time, I can go back and fill that in.
So much to learn, so little time!
Thanks in advance...
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可能对 WPF 应用程序框架 (WAF) 的 BookLibrary 示例应用程序感兴趣a>。它展示了如何将 Entity Framework 4 与 MVVM 结合起来。
You might be interested in the BookLibrary sample application of the WPF Application Framework (WAF). It shows how to combine the Entity Framework 4 with MVVM.