MVVM in WPF and Silverlight - Part 1

Rainer Stropek · 58K views · 2010 · 3:41

Open on YouTube

Software architecture & designSoftware (other)tutorialdated

Why Stack Overflow recommends it

Stack Overflow users link it when answering or asking about MVVM basics in WPF, because the series gives a clear walkthrough of separating concerns.

Recommended by 3 people across 3 different months, 2011 to 2012.

What it is

A short screencast from Rainer Stropek, the first in a series on applying the MVVM (model-view-viewmodel) pattern to WPF and Silverlight applications. This part covers building the model with Entity Framework, recorded as live coding with a few mistakes left in.

What people said

Strong rec coffekid · 2011-10 · Stack Overflow · on “ What kind of WCF services should I create for WPF application? / Domain services”

I would suggest you to create four projects for that porpouse: Yourapp.UI (XAML code and ViewModel) Yourapp.Data (Data Access Layer) Yourapp.Entities (Definition of your business objects) Yourapp.Services (Services Layer aka WCF) Yourapp.Data talks to database and retrieves the desired information. Yourapp.Services maps and transforms that information into your entities (if the logic involved is too complex, perhaps and aditional business layer would be required). From Yourapp.UI just need to add a Service Reference and consume it like a IEnumerable<> and make it reusable so VS won't create additional objects but point to your entities. Yourapp.Entities must be referenced in projects 1,3 and

Recommends Den · 2011-01 · Stack Overflow · on “How to implement such an application using MVVM”

1) This video [this video] helped me with understanding the basics of MVVM. 2) Search on SO for "MVVM Master Detail". 3) "Delete (under certain conditions) an object": read about Commands and Relay Commands: private RelayCommand _delete; public ICommand Delete { get { return _delete ?? (_delete = new RelayCommand(action => DoDelete(), condition => CanDelete)); } } private bool CanDelete { get { return true; // your condition } } 4) "Then in each view, you can Add (through opening an extra dialog)" "Each object has a relation with another one" - you need to let other ViewModels know of changes. Typical solution is to use Mediator pattern. Please refer to following articles: [LINK] [LINK] [LINK] Ed

Recommends Hassan Shifaz · 2012-12 · Stack Overflow · on “Populate WPF Datagrid using binding (MVVM style)”

I'm hoping somebody will direct me to the right path for my problem. I followed a series of videos [this video] from Rainer Stropek on his youtube channel about "MVVM in WPF and Silverlight" two years ago. He showed a very clear cut separation of concerns using the MVVM model. I've got it all working. Now my problem is when I've to display data from multiple entities. For example. I've 2 tables (Jobs and Statuses). Jobs Table jobId, jobNo, jobDate, jobStatus =>(Primary Key of Statuses Table) Statuses Table statusId, statusCaption If i want to display all the Jobs on a datagird and replace the jobStatus with its respective statusCaption, how do i go about writing the ServiceContract and/or Operati