
Explore the fundamentals of MVVM for WPF, including connecting views and viewmodels, design-time data, an IoC-container, navigation and dialogs, parameterized viewmodels, and testing to boost maintainability and testability.
In this lecture we will address the problem of maintainability and testability of applications.
Why MVVM became a standard for developing WPF applications? We will answer to this question and briefly look at the historical background.
You will learn from which components MVVM consists of and what their responsibilities are.
What are Services and what is their role in the MVVM-based applications?
In this lecture you'll take a brief look at the simple educational application we will be working with throughout the course.
In this lecture you'll learn why monolithic design is the pure evil in most cases.
In this lecture you'll learn what to expect from learning and applying the MVVM pattern.
In this lecture we sum up the things we talked about in this module.
In this lecture we will outline the topics connected with the problem of marrying up Views and ViewModels in MVVM-based applications.
In this lecture you'll learn how to name the MVVM components: how to name Views and ViewModels.
In this lecture we will make some preliminary preparations before diving into the MVVM.
In this lecture you'll learn what approaches for connecting Views and ViewModels exist within the MVVM pattern.
In this lecture you'll learn what the View-First approach is in essence.
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.
In this lecture you'll learn what the ViewModel-Locator pattern is. You'll see how to automatically connect ViewModels to Views.
In this lecture you'll briefly look at what the "Inversion of Control" is and what the bootstrapping means.
In this lecture you'll learn how to construct the Bootstrapper within the MVVM pattern and how to attach the IoC-container.
This lecture reveals the problem of validating the layout of data in the design-time (design-mode).
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.
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.
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.
At last! We've reached the ViewModel-First approach. So, what it is?
In this lecture you'll learn how to apply the ViewModel-First approach in practice.
Let's wrap up all the things you've learned in this module.
We will outline to main topics of this module.
In this module you'll learn what commands in WPF are.
In this lecture you'll look at the reusable implementation of the ICommand interface.
In this lecture you'll look at how to apply the RelayCommand implementation in practice.
Commands system in WPF is not sufficient for building the full-fledged communication bridge between Views and ViewModels. Behaviors are for the rescue.
Learn how to develop and apply so-called "Attached Behaviors".
Blend Behaviors are more powerful than bear Attached Behaviors. Look at them in practice.
In this lecture you'll learn what is the "MessageBus" (EventAggregator) pattern in essence.
In this lecture you'll learn how to apply "MessageBus" (EventAggregator) in practice.
Let's wrap up the main topics of this module.
In this lecture we will outline the main topics of this module.
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?
In this lecture I'll introduce you to the concept of UI-Composition.
Learn how to navigate to ViewModels which don't require parameters to be passed in via their constructors.
Learn how to navigate to ViewModels which require parameters to be passed in their constructors.
A little homework for students.
Introduction to the problem of opening dialogs.
In this lecture you'll see one of the approaches to opening dialogs in MVVM.
In this lecture you'll see how to apply the API we discussed in the previous lecture.
In this lecture you'll learn how to keep the reusable INPC implementation in the MVVM framework.
Let's wrap up the main topics of this module.
In this lecture we will outline the main topics of this module.
Learn why you may want to wrap a model in MVVM.
Learn the different between two different approaches to managing the state of data: Stateful ViewModel and Stateless ViewModel.
Learn how you can implement validation in WPF.
Learn how to implement and apply the INotifyDataErrorInfo interface for validation.
Learn how to implement and apply the INotifyDataErrorInfo interface for validation.
Do a little homework.
Wrap up the main topics of this module.
We will outline the main topics of this module.
In this lecture you'll learn what modern popular MVVM frameworks exist.
In this lecture we will take a brief look at Prism and MVVM-Light.
In this lecture you'll be introduced to the Caliburn.Micro MVVM framework.
Learn how to use the Caliburn.Micro MVVM framework in practice.
Wrap up the main topics of this module.
Last recommendations and a bunch of helpful links.
Learn how to write unit tests for ViewModels using MSTest.
Learn to build a real-world Wpf application by authoring Xaml layouts, creating two windows, and implementing mvvm using code-behind and an mvvm framework to improve maintainability.
Develop a true or false game in a WPF application to illustrate MVVM concepts, including a statement editor, XML-based storage, and a two-window interface in a .NET Framework 4.5 project.
Construct a WPF main window using a dock panel with a top file menu, a bottom button row, a numeric up-down, a true/false checkbox, and a full-width statement editor.
Create a serializable statement class and a persistence layer to save and load statements via XML in a WPF main window. Implement add, edit, navigate, and UI state management.
Construct a two-row game window in wpf (GameWindow.xaml) using a grid, a text block in the first row, and exit, false, and true buttons with a state display.
Implement the game window logic by wiring event handlers, managing statements, a counter, and a score; process true/false answers and show the final score.
Explore why mvvm in wpf is complex and learn bootstrapping, ioc setup, and creating a structured solution with Caliburn Micro, Castle Windsor, and Extended WPF Toolkit.
Bootstrap a Caliburn Micro framework app with a Windsor container, register view models and services, and drive ActiveItem on the shell view to activate the main view.
Implement a dialog service to keep view models testable and enforce separation of presentation concerns, by updating the statement model with INotifyPropertyChanged and wiring IDialogService in the Bootstrapper.
Implements the remaining part by wiring the main and game views with Caliburn Micro, using design-time context, binding, and naming conventions for automated actions and unit testing.
The outline of the section dedicated to Dependency Inversion Principle (DIP) and Dependency Injection (DI) where you'll learn the main definitions and concepts.
Learn what is Dependency Inversion Princple (DIP) in essence.
Learn the definition of a dependency.
Learn the difference between volatile dependencies and stable dependencies.
Learn what is "inversion of control" and "dependency injection".
Look at an example of DIP violation on practice.
Look at the refactoring process based on Dependency Injection (DI) that leads to a better design of the application.
Learn different Dependency Injection (DI) techniques such as Constructor Injection, Property Injection and Method Injection.
Learn about the architectural implications of dependency injection.
Learn about the common smells of Dependency Inversion Principle (DIP) violation.
A conclusion of the section dedicated to Dependency Inversion Principle (DIP) and Dependency Injection (DI). Recap what you learned.
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 respect your time. The course material is succinct, yet comprehensive. All important concepts are covered. Particularly important topics are covered in-depth. 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