2
A
回答
0
如果您正在尋找一類,在應用程序的beggining配置容器,你可以下載最新Prism下降並查找UnityBootstrapper類。
考慮到這只是註冊Prism應用程序運行所需的服務,因此您的引導程序可能需要不同的容器配置。
0
您可以在WPF:MVVM & Unity Kiosk示例項目中找到另一個示例。在這裏,Bootsrapper類:
public class Bootstrapper
{
public Bootstrapper(IUnityContainer container)
{
this.container = container;
}
public Bootstrapper RegisterModule(Type moduleType)
{
IModule module = container.Resolve(moduleType) as IModule;
if (module == null)
throw new ArgumentException("moduleType");
module.Register(container);
return this;
}
private IUnityContainer container;
}
而且IModule的接口:
public interface IModule
{
void Register(IUnityContainer container);
}
最後,其中一個模塊來實現的:
public class PhotoEditorModule : IModule
{
public void Register(IUnityContainer container)
{
// register default controller
container.RegisterType<IPhotoEditor, Controller>();
// register view models
container.RegisterType<IPhotoEditorViewModel, PhotoEditorViewModel>();
container.RegisterType<IPhotoEditorMenuViewModel, PhotoEditorMenuViewModel>();
}
}
相關問題
- 1. 從示例Java程序獲取導入的文件到新程序
- 2. WiX引導程序主題文件?
- 3. PHPUnit:多引導程序或XML文件?
- 4. 無法獲取引導程序4 Datatables示例運行
- 5. Spring引導OAuth2示例
- 6. faq引導程序示例 - >不工作在引導程序上有腳本錯誤
- 7. 在Angular應用程序中找不到引導程序文件
- 8. WiX引導程序:跳過引導程序UI,先顯示MSI對話框
- 9. 引導懸停圖像顯示示例
- 10. 引導程序圖標不顯示
- 11. 未能顯示引導程序UI Modal
- 12. 背景不顯示在引導程序
- 13. ComboBox不顯示引導程序
- 14. Twitter引導程序 - 圖像不顯示
- 15. 示例程序會顯示不在Google Drive中的文件?
- 16. 更改引導程序中的事件顯示全日曆
- 17. 嚮導控件的示例
- 18. 使用引導程序2.0使用引導程序2.0使用.table-striped對錶格中的jQuery突出顯示效果使用引導程序引導
- 19. Yammer導出API示例文件
- 20. Rails引導程序
- 21. 引導程序GUID
- 22. RPI 3硬件PWM的示例程序?
- 23. WiX:在安裝過程中獲取引導程序文件名
- 24. 摺疊的引導程序導航欄不顯示
- 25. 谷歌應用程序引擎的靜態文件處理程序例如
- 26. 引導程序的大小
- 27. MSBuild中的引導程序
- 28. Arduino引導程序序列
- 29. 引導程序崩潰文本/拉右
- 30. Wiimote示例程序