Force PRISM to use another instance of UnityContainer
I have UnityContainer in my app yet. Now I want to add use of PRISM to my app and I want PRISM to use my Container instead of its inner one defined in bootstrapper. Or I would also satisfied if I could c开发者_Python百科reate some kind of link between these two containers in order when I call MyContainer.Resolve() it could redirect this call to PRISM's container and resolve type that registered in PRISM, i.e RegionManager.
Thanks in advance!
I think you only need to override the CreateContainer()
method in your application's bootstrapper and return your own IUnityContainer
:
protected override IUnityContainer CreateContainer()
{
// return your container here...
}
精彩评论