Episode

Use Dependency Injection (Part 15 of 18) | Building Apps with XAML and .NET MAUI

with Robert Green, Leslie Richardson, Paul Sheriff

Welcome to the Building Apps with XAML and .NET MAUI series. Whether you are new to XAML or simply new to the XAML used in .NET MAUI, this series will show you how to start building a .NET MAUI app. In this episode, Paul shows how to reduce class coupling by using dependency injection.

Chapters

  • 00:00 - Introduction
  • 00:55 - Why use dependency injection?
  • 03:20 - How to use it in .NET MAUI apps
  • 05:50 - Service lifetimes
  • 08:00 - Demo of adding it to the app
  • 09:00 - Adding a data layer class library
  • 11:40 - Calling the data layer via dependency injection
  • 15:35 - Discussion
  • 19:55 - Using dependency injection in views and view models
  • 23:15 - Using dependency injection with lists
  • 26:45 - Wrap-up

Developer
.NET
.NET MAUI