Search code examples
xamarin.formssimple-injector

Simple Injector fallback to Xamarin Forms DependencyService


I'm looking for a way that I can get Simple Injector to locate services registered with the Xamarin Forms Dependency Service, when the services cannot otherwise be resolved by the Container. Is there a way to do this with Simple Injector?


Solution

  • Unregistered type resolution can be implemented using the Container.ResolveUnregisteredType event.

    Do note however that you should take my warnings as stated in the comments very seriously. Your scenario is not a good case for unregistered type resolution.