Prism can be used with other container beside the ones that are supported as out of the box, but it requires to perform certain tasks to “adapt” the container to Prism. To start, you will need to:
· Create a custom implementation of IServiceLocator
like you mentioned above.
· Create a custom implementation of a bootstrapper.
· Register all the services and types provided by Prism in the new container.
However, if the container you want to use is well known by the community, you might be able to find a post or project describing an approach to use it .
A good example of what changes you might need to adapt the container to Prism can be found in Prism’s source code. The project
contains most of the main functionality used in Prism but does not depend on any container. The extensions required to use
are located in the corresponding
projects. There it can also be seen that the amount of effort required to adapt the container depends on the container itself:
just requires a couple of classes while MEF
needs to create subclasses of almost any Prism service to be able to export them.
In my opinion, using a different container might be worth the effort if the container provides a functionality that is not available in MEF or Unity and that you need to use in your project. If not, then it might be simpler to use the containers that are supported
as out of the box.