0

I am facing the following problem with Prism and DryIoC. My contaier is set up with different scopes for reusing dependencies within those scopes. This works fine on injected dependencies. But as soon as I use Prisms navigation (_regionManager.RequestNavigate) or view discovery (_regionManager.RegisterViewWithRegion) mechanisms, this breaks up. I guess this is because both use the ServiceLoctor and the DryIocServiceLocatorAdapter resolves dependencies directly from the container.
Is there any built-in-option to make this work or any idea how to solve this in a good way?

stiefel
  • 1
  • 2
  • What are the scopes you desire to be used when navigating? – Haukinger Mar 27 '20 at 07:14
  • In my case I have a view that has some views embedded into a region (tab control). All those should work on the same Entity Framework DatabaseContext which is injected to teir corresponding viewmodels (not directly but via different access layers). The context is registered per 'Reuse.Scoped' and the top level view is opened in a new scope. However the nested views don't resolve from that scope. – stiefel Mar 27 '20 at 10:37

0 Answers0