
Learn WinUI 3.0
By :

Before starting down the path of using DI in our project, we should take some time to understand what DI is and why it is fundamental for building modern applications. You will often see DI referenced with another related concept, Inversion of Control (IoC). Let's discuss these two concepts, clarify the relationship between them, and prepare you to use DI properly in this chapter.
DI is used by method developers to inject dependent objects into a class rather than creating instances of the objects inside of the class. There are different ways to inject those objects:
The most common method of DI is constructor injection. In this chapter, we will be using both property injection and constructor injection. Method injection will...