开发者

Force PRISM to use another instance of UnityContainer

开发者 https://www.devze.com 2022-12-24 11:55 出处:网络
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 coul

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...
}
0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号