This Is How Simple Dependency Injection is in .NET MAUI

preview_player
Показать описание
If you have been working with dependency injection in other .NET solutions like ASP.NET, this should look pretty familiar! In this video we will learn how to use dependency injection in your .NET MAUI app. And also, a little pro-tip on how to anticipate with your Xamarin app... Tune in!

💝 Join this channel to get access to perks:

🔗 Links

⏱ Timestamps
00:00 - Intro
00:08 - Sample App Outline
01:05 - Generic Host Builder in .NET MAUI
02:18 - Register Dependencies in Container
03:33 - Pro-Tip For Forms to .NET MAUI Conversion
04:06 - Using Constructor Injection
06:01 - Inject View Model
09:04 - Outro

🙋‍♂️ Also find my...

#dotnetmaui #maui #dependencyinjection #dotnet #csharp
Рекомендации по теме
Комментарии
Автор

Thank you Gerald! I'm eager to see more .NET MAUI tutorials!~~

finch
Автор

Very good video, thanks. I'm really excited to see what else is coming new in .NET MAUI

GellClan
Автор

Hi Gerald, Thank you for the video, short and useful

thomaseslier
Автор

Hello Gerald, first of all, thank you again for the job you do, I am happy to see that the channel is growing. I wanted to ask you if there is any way to set the camera to 9:16 while using it, and to add a usage timer at the same time.
In other words, is there any way to make the camera (using Xamarin Forms) behave in a similar way to how it does using Instagram Reels, youtube shorts, Tik Tok videos...

jwj
Автор

Hi Gerald, thanks for the videos. How do we get a DI viewmodels to a shell content page ? It seems shell pages do not support constructor injection. Thanks!

RVlietstra
Автор

gr8 vid like always, i wanna ask u if i am building an app with MAUI and on mobile screen i want an item to take the size of the entire row but if i have a bigger screen like a pc or a laptop or tables i want that item to no longer take the size of the entire row instead to take the size of a col and then have more that one item on the same row, can u please show us how to make responsive screen designs with MAUI to have a good ui/ui on multi sized screens. and keeep going i am learning a lot from u

michelchaghoury
Автор

For the love of G-d, can you please make a tutorial on how to change the header bar colors of the WinUI and other shells in Maui Blazor? There is very little documentation on this. CommandBarBackgroundColor, etc? Thank you!

juliandormon
Автор

In my tests i can't work with DependencyInjection with Shell

'Cannot dynamically create an instance of type 'SOManager.Pages.LoginPage'. Reason: No parameterless constructor defined.'

zoiobnu
Автор

Hi Gerald. Awesome video as always. Any update regarding Apple M1 vs Visual studio for mac?

argonjs
Автор

Hi, Gerald. Why are you write like - Message{get;} = " ..."? is not simple to do like Message => " ..."?

alexmidnayt
Автор

Hi Gerald, I need your help. I would like to do where i tapped on the device, i need to know X, Y location of tapped position. I couldn't find any where. could you help me please? . Thank You

adiguzelburak
Автор

You referenced an earlier video where you talk about host builders -- can you provide a link to that? Google's not being helpful (and it's too new for ChatGPT)

michaelrogers
Автор

is it possible to inject viewmodels into custom controls/ contentviews?

maxborrmann
Автор

Hi Gerald, why is the splash screen not working on windows. Please advise

vinothswami
Автор

Hi, how are you? Can you please tell me how can i use ConsumerIrManager service in .net maui? I couldn't find any info regarding this. Thanks

mapanjwani
Автор

Would like to see the implementation with Microsoft.Extensions framework.

egvijayanand