Question

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?

Was it helpful?

Solution 2

MVVM does not specify where you start from, or how you deal with databases.

MVVM specifies you must get rid of the horrible code-behind hacks abundant in some useless dinosaur UI frameworks such as winforms and use DataBinding instead.

Therefore, just go ahead with your existing infrastructure, and make sure you don't manipulate or create UI elements in procedural code.

OTHER TIPS

In my opinion there is nothing wrong in Database-first approach, even it's quite good, because you would have general view at project (data side).

I would recommend you to start MVVM approach using Caliburn.Micro framework, it's easy, powerful and really nice.

Caliburn.Micro - getting started - part 1 - you can find there all 5 parts.

Caliburn.Micro - framework

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top