0

I creating my first WPF application, and the goal of this is to basically be a data entry application for the database for CRUD operations (for example, creating a new customer in a new window, editing a customer, displaying a list of customers, etc). A database has been created, and I have thus created a Models folder to contain the .edmx file, dbcontext stuff, and partial classes generated from ADO Entity Data Model tool.

EDIT:

My question is, now, how do I go on with MVVM with my ViewModel and Models working together. All the tutorials I have seen show starting from scratch, and not using existing classes. For example, all tutorials would show creating a brand new Customer class, vs just going off the partial Customer class that was created for me.

I don't want to start over, so how do I follow these tutorials alongside the classes that were created for me through Entity Framework from my database?

4

2 回答 2

1

在我看来,数据库优先的方法没有任何问题,即使它非常好,因为你会对项目(数据方面)有一般的看法。

我建议您使用 Caliburn.Micro 框架启动 MVVM 方法,它简单、强大且非常好。

Caliburn.Micro - 入门 - 第 1 部分- 您可以在那里找到所有 5 个部分。

Caliburn.Micro - 框架

于 2013-06-24T19:46:25.730 回答
0

MVVM 没有指定你从哪里开始,或者你如何处理数据库。

MVVM 规定你必须摆脱一些无用的恐龙 UI 框架(如 winforms)中大量的可怕的代码隐藏黑客,并改用 DataBinding。

因此,只需继续使用现有的基础架构,并确保您不在过程代码中操作或创建 UI 元素。

于 2013-06-24T19:45:08.993 回答