新建一个主窗体一个Module,配置完成
原来加载方法是重写ConfigureModuleCatalog
protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog) { moduleCatalog.AddModule<Mudule.MuduleAClass>(); }
使用配置文件加载:
<?xml version="1.0" encoding="utf-8" ?> <configuration> <configSections> <section name="modules" type="Prism.Modularity.ModulesConfigurationSection, Prism.Wpf" /> </configSections> <startup> </startup> <modules> <module assemblyFile="Mudule.dll" moduleType="Mudule.MuduleAClass, Mudule" moduleName="MuduleAClass" startupLoaded="True" /> </modules> </configuration>
protected override IModuleCatalog CreateModuleCatalog() { return new ConfigurationModuleCatalog(); }