Back to Browse

Avalonia UI - 06 - Dependency Injection

7.3K views
Dec 11, 2023
7:44

Hello everyone and welcome to this new episode of the Avalonia UI series. In this video we'll dive into Dependency Injection and how to use it inside an Avalonia project. ► DI definitions: Wikipedia: https://en.wikipedia.org/wiki/Dependency_injection Microsoft learn: https://learn.microsoft.com/en-us/dotnet/core/extensions/dependency-injection ► 3rd party DI containers: DI in Avalonia using Lamar by Khalid Abuhakmeh: https://khalidabuhakmeh.com/dependency-injection-with-avalonia-ui-apps) DI using Reactive Splat: https://www.reactiveui.net/docs/handbook/dependency-inversion/ ► DI using Microsoft packages StackOverflow question: https://stackoverflow.com/questions/71119254/avaloniaui-what-is-the-proper-way-to-inject-viewmodels-into-views-using-compos Add MsExtensionsHostingSample sample project PR: https://github.com/AvaloniaUI/Avalonia.Samples/pull/64 Sample code to set up view locator using Microsoft DI from kekekeks: https://github.com/AvaloniaUI/Avalonia.Samples/issues/35#issuecomment-1328118863 Reddit question: https://www.reddit.com/r/AvaloniaUI/comments/ssplp9/microsoftextensionsdependencyinjection_to_inject/ ► CommunityToolkit Experimental package Experimental package PR: https://github.com/CommunityToolkit/Labs-Windows/discussions/463 How to fetch packages from the community toolkit preview Nuget Feed: https://github.com/CommunityToolkit/WindowsCommunityToolkit/wiki/Preview-Packages Example project to showcase the use of the CommunityToolkit Experimental package: https://github.com/stevemonaco/AvaloniaViewModelFirstDemos ► GitHub repo: https://github.com/MammaMiaDev/avaloniaui-the-series 0:00 Intro 0:52 Dependency Injection 2:08 DI in Avalonia 2:56 3rd party DI containers 3:40 Microsoft DI packages 4:31 Community Toolkit Labs DI package 5:31 Sample project 6:36 Conclusions

Download

0 formats

No download links available.

Avalonia UI - 06 - Dependency Injection | NatokHD