Xamarin Forms - Pass Scope-Injected service from tabbedpageviewmodel to the viewmodels of the pages

我是研究僧i 提交于 2020-05-24 05:07:26

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!