问题
In my xamarin forms application I have a tabbedpage with behind it a viewmodel. This viewmodel behind injects a service with dependency injection. That service is scoped. It should be scoped for the tabbedpageviewmodel. But the tabs should also make use of that scoped service. How can I achieve this?
Should I pass the service to the tabbedpages-viewmodels?
Singleton is not an option, because I work with notifications, the tabbedpageviewmodel can accur multiple times in the navigationstack, and the service should be different then.
来源:https://stackoverflow.com/questions/61224445/xamarin-forms-pass-scope-injected-service-from-tabbedpageviewmodel-to-the-view