I am converting my Xamarin Forms Application to #dotnetMAUI. In Xamarin I used dryloc for dependency injection. But since dependency injection was built in MAUI, I would like to use it. My question is, how can I configure a bunch of services and view models later into the container? My app is developed as a bunch of modules and initially, I just want to put the services and view models into the container that is required by the App's start-up page. SO that the start-up will be fast. In dryloc this was possible but I am not sure how to do it in the Maui app.
e.g.
I have two modules.
- Startup Module which contains only a startup page view model and its services.
- Chat Module which contains all the view models and services required for chat.
So, at first, I would like to configure the startup module in IOC container while creating the MAUI app.
And once the start-up page is open and the user clicks on something, I would like to put services and view models of the chat module into the IOC container.
In total, there are more than 200 services and view models in the app, and putting all those in the IOC container at the beginning might affect the start performance. In Xamarin Forms, It was the case and that is why I followed this approach.