EntityList / EntityCollection

编程入门 行业动态 更新时间:2024-10-24 15:18:49
EntityList / EntityCollection - MVVM示例(EntityList / EntityCollection - MVVM Example)

我正在使用April工具包中的新EntityList来公开ViewModel中的集合。 我还将FK公开为EntityCollections。

我以为我会将该集合公开为IEnumerable,它使用通用接口处理集合的暴露。 这留下了我绑定到网格/列表的FK ....我可以使用EntityCollection创建一个带有嵌入对象的枚举吗? 这是“正确的”方式吗?

我还构建了许多用户控件,每个控件都有自己的viewmodel。 这是否意味着页面应该有一个viewmodel,其中的其他viewmodel聚合在一起? 如果每个控件都独立存在,那么当用户控件嵌入到页面中时,会实现自己的viewmodel吗?

我知道我也可以跳到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...

最满意答案

您可能对WPF应用程序框架(WAF)BookLibrary示例应用程序感兴趣。 它展示了如何将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.

更多推荐

本文发布于:2023-08-02 20:42:00,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1381491.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:EntityList   EntityCollection

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!