How to manage view models in viewports?
Hello
I'm trying to learn the ViewModel pattern. I want to ask you about a subject that I cannot understand.
I am implementing Dependency Injection using the Microsoft.Extensions package. I recorded the database and message services I use. So far, no problem.
In my project I have view models that manage views. In some sources, it is recommended to register all these as services at the beginning of the application and use them through dependency. This doesn't seem right to me in terms of performance. The correct approach would be to save these view models as services or to manage them dynamically by creating instances through a central navigation class. Finally, use the navigation class by registering it as a service.
Can you guide me on this?
Thanks.