MVVM in WPF Survival Guide From A to Z
4.0 (345 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
2,090 students enrolled

MVVM in WPF Survival Guide From A to Z

Learn how to create a maintainable Windows application applying MVVM to WPF. Introduction to Caliburn.Micro.
4.0 (345 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
2,090 students enrolled
Created by Engineer Spock
Last updated 3/2018
English
English [Auto-generated]
Current price: $11.99 Original price: $44.99 Discount: 73% off
4 days left at this price!
30-Day Money-Back Guarantee
This course includes
  • 4.5 hours on-demand video
  • 4 articles
  • 2 downloadable resources
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to Udemy's top 3,000+ courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Logically and physically structuring WPF applications according to MVVM pattern
  • Apply either View-First or ViewModel-First approach

  • Set up Design-Time Data

  • Build a communication bridge between Views and ViewModels
  • Correctly apply a static message bus
  • Organize navigation
  • Validate Models
  • Build your own MVVM framework
Course content
Expand all 92 lectures 04:20:50
+ Introduction to MVVM
10 lectures 29:47
How to Ask Questions
00:24

In this lecture we will address the problem of maintainability and testability of applications.

Preview 02:26

Why MVVM became a standard for developing WPF applications? We will answer to this question and briefly look at the historical background.

Why MVVM?
03:41

You will learn from which components MVVM consists of and what their responsibilities are.

MVVM in a Nutshell
07:25

What are Services and what is their role in the MVVM-based applications?

Services in MVVM
01:57

In this lecture you'll take a brief look at the simple educational application we will be working with throughout the course.

Preview 03:51

In this lecture you'll learn why monolithic design is the pure evil in most cases.

Problems of Monolithic Design
02:43

In this lecture you'll learn what to expect from learning and applying the MVVM pattern.

Downsides of MVVM
01:58

In this lecture we sum up the things we talked about in this module.

Conclusion
01:25
+ Connecting Views and ViewModels
17 lectures 42:57

In this lecture we will outline the topics connected with the problem of marrying up Views and ViewModels in MVVM-based applications.

Outline
00:55

In this lecture you'll learn how to name the MVVM components: how to name Views and ViewModels.

Naming Conventions
01:47

In this lecture we will make some preliminary preparations before diving into the MVVM.

Preparing the Solution
04:15

In this lecture you'll learn what approaches for connecting Views and ViewModels exist within the MVVM pattern.

View-First VS ViewModel-First
00:47

In this lecture you'll learn what the View-First approach is in essence.

View-First Intro
02:29

In this practical lecture you'll learn how to apply the View-First approach straightforwardly. It means we will look at how to create ViewModels in XAML and code-behind.

Straightforward View-First Implementation
03:43

In this lecture you'll learn what the ViewModel-Locator pattern is. You'll see how to automatically connect ViewModels to Views.

Preview 03:13
Dependency Injection and Inversion of Control
00:12

In this lecture you'll briefly look at what the "Inversion of Control" is and what the bootstrapping means.

Preview 03:12

In this lecture you'll learn how to construct the Bootstrapper within the MVVM pattern and how to attach the IoC-container.

Preview 04:09

This lecture reveals the problem of validating the layout of data in the design-time (design-mode).

Design-Time Data. Intro
01:49

In this lecture you'll see how to create separate ViewModels suited specifically for loading the design-time data. After that you'll look at how to mix the runtime and design-time logic.

Design-Time Data. Demo: Separate ViewModels and Mixing In.
04:14

In this lecture you'll see the slick approach to instantiating ViewModels in order to inject into them design-time dependencies. This allows to avoid mixing the runtime and design-time logic as well as to avoid creation of any additional ViewModels.

Design-Time Data. Demo: Avoiding Duplication.
02:27

We've detracted a little bit. So, in this lecture we get back to the main topic of this module: marrying up Views and ViewModels. In this lecture you'll learn another form of the ViewModel-Locator pattern when it poses itself as a container of ViewModels.

View-First via ViewModel-Locator. Locator as a Container.
01:53

At last! We've reached the ViewModel-First approach. So, what it is?

ViewModel-First. Intro
01:38

In this lecture you'll learn how to apply the ViewModel-First approach in practice.

ViewModel-First. Demo
05:09

Let's wrap up all the things you've learned in this module.

Conclusion
01:05
+ Communicating Views and ViewModels
10 lectures 22:34

We will outline to main topics of this module.

Outline
00:41

In this module you'll learn what commands in WPF are.

Commands in WPF and MVVM
01:46

In this lecture you'll look at the reusable implementation of the ICommand interface.

RelayCommand. Intro
01:03

In this lecture you'll look at how to apply the RelayCommand implementation in practice.


RelayCommand. Demo
06:10

Commands system in WPF is not sufficient for building the full-fledged communication bridge between Views and ViewModels. Behaviors are for the rescue.

Behaviors. Intro
02:10

Learn how to develop and apply so-called "Attached Behaviors".

Attached Behaviors
03:03

Blend Behaviors are more powerful than bear Attached Behaviors. Look at them in practice.

Blend Behaviors
02:02

In this lecture you'll learn what is the "MessageBus" (EventAggregator) pattern in essence.

MessageBus. Intro
00:48

In this lecture you'll learn how to apply "MessageBus" (EventAggregator) in practice.

MessageBus. Demo
03:51

Let's wrap up the main topics of this module.

Conclusion
01:00
+ Navigation and Other Services
11 lectures 22:49

In this lecture we will outline the main topics of this module.

Outline
00:49

In this lecture we will talk about structuring solutions from the MVVM perspectives. Is it better to keep all the Views and ViewModels in a single project?

Locating MVVM Components
01:39

In this lecture I'll introduce you to the concept of UI-Composition.

UI-Composition
01:02

Learn how to navigate to ViewModels which don't require parameters to be passed in via their constructors.

Navigation without Parameters
03:55

Learn how to navigate to ViewModels which require parameters to be passed in their constructors.

Navigation with Parameters
03:11

A little homework for students.

Homework: Navigation without MessageBus
00:48

Introduction to the problem of opening dialogs.

Dialogs. Intro
00:33

In this lecture you'll see one of the approaches to opening dialogs in MVVM.

Dialogs API Demo
04:02

In this lecture you'll see how to apply the API we discussed in the previous lecture.

Applying Dialogs API
04:24

In this lecture you'll learn how to keep the reusable INPC implementation in the MVVM framework.

Making INotifyPropertyChanged Less Painful
01:33

Let's wrap up the main topics of this module.

Conclusion
00:53
+ Models and Validation
8 lectures 12:49

In this lecture we will outline the main topics of this module.

Outline
00:38

Learn why you may want to wrap a model in MVVM.

Models Wrapping
01:30

Learn the different between two different approaches to managing the state of data: Stateful ViewModel and Stateless ViewModel.

Stateful ViewModel VS Stateless ViewModel
01:43

Learn how you can implement validation in WPF.

Validation. Intro
01:45

Learn how to implement and apply the INotifyDataErrorInfo interface for validation.

Validation. Demo 1.
02:06

Learn how to implement and apply the INotifyDataErrorInfo interface for validation.

Validation. Demo 2.
04:04

Do a little homework.

Homework: Apply Validation for managing the state of UI
00:05

Wrap up the main topics of this module.

Conclusion
00:58
+ MVVM Frameworks
6 lectures 11:59

We will outline the main topics of this module.

Outline
00:56

In this lecture you'll learn what modern popular MVVM frameworks exist.

MVVM Frameworks
01:34

In this lecture we will take a brief look at Prism and MVVM-Light.

Prism and MVVM-Light
02:07

In this lecture you'll be introduced to the Caliburn.Micro MVVM framework.

Caliburn.Micro. Intro
02:49

Learn how to use the Caliburn.Micro MVVM framework in practice.

Caliburn.Micro. Demo
03:44

Wrap up the main topics of this module.

Conclusion
00:49
+ Wrap Up
1 lecture 01:40

Last recommendations and a bunch of helpful links.

Final Words
01:40
Test 1
13 questions
Test 2
9 questions
+ Appendix A. Unit Testing.
1 lecture 04:41

Learn how to write unit tests for ViewModels using MSTest.

Preview 04:41
+ Appendix B: Implementing a Real-World Application
11 lectures 54:51
Outline
01:10
"True or False" Game
01:48
Constructing MainWindow.xaml
12:01
Implementing Logic of MainWindow
11:37
Constructing GameWindow.xaml
04:10
Implementing Logic of GameWindow
03:38
Problems of Monolithic Design
00:09
Preparing MVVM-based Application
04:38
Bootstrapping with Caliburn.Micro and Castle.Windsor
06:27
Bringing Models and Services
02:54
Implementing the Remaining Part
06:19
+ Appendix C1: Dependency Inversion Principle.
11 lectures 41:48

The outline of the section dedicated to Dependency Inversion Principle (DIP) and Dependency Injection (DI) where you'll learn the main definitions and concepts.

Outline
01:34

Learn what is Dependency Inversion Princple (DIP) in essence.

DIP Definition
03:30

Learn the definition of a dependency.

Dependencies
04:12

Learn the difference between volatile dependencies and stable dependencies.

Volatile and Stable Dependencies
02:53

Learn what is "inversion of control" and "dependency injection".

Definitions of IoC and DI
03:18

Look at an example of DIP violation on practice.

DIP Violation Demo
02:25

Look at the refactoring process based on Dependency Injection (DI) that leads to a better design of the application.

Refactoring to a Better Design Applying DI
08:12

Learn different Dependency Injection (DI) techniques such as Constructor Injection, Property Injection and Method Injection.

DI Techniques
05:54

Learn about the architectural implications of dependency injection.

Architectural Implications
05:24

Learn about the common smells of Dependency Inversion Principle (DIP) violation.

Common Smells of DIP Violation
02:11

A conclusion of the section dedicated to Dependency Inversion Principle (DIP) and Dependency Injection (DI). Recap what you learned.

Conclusion
02:15
Requirements
  • You should already have a decent C# and a little bit of WPF experience.
Description

MVVM (stands for Model-View-ViewModel) is a well-known architectural pattern in the world of WPF. Most enterprise level WPF applications are MVVM-based.

Learn deeply the concepts lying behind the MVVM pattern in order to understand what MVVM is in essence and how to pragmatically apply it to a WPF application. This is a great MVVM tutorial for beginners (beginners in MVVM, don't forget to look at prerequisites)!

Teaching Approach  

No fluff, no ranting, no beating the air. I esteem your time. The course material is succinct, yet comprehensive. All important concepts are covered. Particularly important topics are covered in-depth. For absolute beginners, I offer my help on Skype absolutely free if requested. Don't forget that this course has English subtitles, so if you don't understand my accent, feel free to turn them on.

Take this course and you will be satisfied.  

Build a strong foundation in applying MVVM with this course  

In the case you’re just familiar with the WPF framework, learning this course will give you a level-up since you’ll be capable of developing professional WPF applications. Applying MVVM intelligently is a “must have” skill for WPF developers.  

If you are an experienced WPF developer, you might be interested in how MVVM frameworks may work under the hood. Throughout the course, we will be building a small MVVM framework similar to Caliburn.Micro.  

Content and Overview  

This course is primarily aimed at intermediate developers. Experts may also find interesting MVVM tricks provided in this course. If you are a beginner, be sure you’re ready to take this course, since it requires from you a solid C#-background and acquaintance with WPF.  

This course provides solid theoretical base reinforced by tons of practical material. This course is very practical (except the very first introductory module).  

“MVVM in WPF” is a very wide topic and it’s hardly possible to cover all the related challenges arising while applying MVVM. That’s why this course includes the most important topics understanding of which is a key for successful development. We will sacrifice some topics which may be interesting for students, but which are hardly connected with MVVM directly. What I’m talking about is, for example, the problem of setting up a full-fledged data access layer. Such topics are omitted.  

The most beneficial aspect of this course is that it gives you the deep understanding of the MVVM pattern. For example, you’ll see how to pass parameters to ViewModels through constructors, without using a static message bus, or passing parameters by explicitly setting properties of a ViewModel.  

In short, the course covers the following topics:  

  • MVVM background: what is MVVM, why to use it, when to use MVVM etc.

  • Connecting Views and ViewModels: View-First and ViewModel-First approaches  

  • Design-Time data support  

  • Configuring and using an IoC-container (by the example of Castle.Windsor  

  • Communication channel between Views and ViewModels: commands, attached and blend behaviors, static message bus (EventAggregator)  

  • Navigation: hierarchical UI composition, how to open dialogs, including modal dialogs, navigating to parameterized ViewModels (pass parameters into their constructors)  

  • Models and validation  

  • MVVM toolkits: Caliburn.Micro more closely

  • Unit-Testing of ViewModels

In the end, we will recap what you have learned and you will try to understand where you have to go further with the intention to master your skills. Here we will have a discussion of different paths you can go on.

------------------------------------------------------------

Keywords related to the course:

  • MVVM in WPF

  • MVVM tutorial

  • MVVM pattern

  • Model-View-ViewModel MVVM tutorial

  • Caliburn.Micro

  • View-First

  • ViewModel-First

Who this course is for:
  • Intermediate developers who want to learn MVVM
  • Experts who applied MVVM, but lack the deep understanding of it
  • It is not for beginners with the lack of C# experience or no WPF experience