2010-06-04 35 views

回答

2

您需要使用Unity註冊類型,並指定所有的參數:

this.container.RegisterType<View1>(new InjectionConstructor(this.container.Resolve<IRegionManager>(), this.container,true)); 

然後,它會知道如何解決它。這種做法有點失敗了,這就是爲什麼你可能會更好地將bool值設置爲屬性,並改爲使用InjectionProperty

+0

我嘗試過RegisterType,但仍然沒有運氣。謝謝,現在我正在使用接口和屬性來設置變量。 – 2010-06-07 06:58:58

相關問題