Click here to Skip to main content
15,890,527 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am trying a hello world program in Prism.WPF 7.0. I am trying to load a module from app.config file. Which is not working. I am using PrismApplicationsince isUnityBootstrapper Obsolete in Prism.WPF 7.0

My app.config as

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="modules" type="Prism.Modularity.ModulesConfigurationSection, Prism.Wpf" />
  </configSections>
  <startup>
  </startup>
  <modules>
    <module assemblyFile="ModuleA.dll" moduleType="ModuleA.ModuleAModule, ModuleA, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" moduleName="ModuleAModule" startupLoaded="True" />
  </modules>
</configuration>


My app.xaml.cs
internal partial class App : PrismApplication
    {
        //ShellView _tempShellView;
        protected override Window CreateShell()
        {
            var _tempShellView = Container.Resolve<ShellView>();
            var _tempDataContext = Container.Resolve<ShellViewModel>();
            _tempDataContext.ShellWindowClose = new Action(() => _tempShellView.Close());
            _tempShellView.DataContext = _tempDataContext;
            _tempDataContext.Initialize();

            return _tempShellView;
        }

        protected override void InitializeShell(System.Windows.Window shell)
        {
            shell.Show();
        }

        protected override IModuleCatalog CreateModuleCatalog()
        {
            return new ConfigurationModuleCatalog();
            //return  new DirectoryModuleCatalog() {  ModulePath = Environment.CurrentDirectory };
        }
    }

my ModuleAModule.cs
public class ModuleAModule : IModule
    {
        IRegionManager _regionManager;

        public ModuleAModule(RegionManager regionManager)
        {
            _regionManager = regionManager;
        }

        public void Initialize()
        {
            _regionManager.RegisterViewWithRegion("ContentRegion", typeof(ViewA));
        }
    }


What I have tried:

When I try this code with 6.3 it's working onUnityBootstrapper Need help on this Prism.WPF 7.0
Posted
Updated 28-Mar-18 3:22am

1 solution

Kindly check the github sample code which i created on this. you need to upgrade the NuGet package to use 7.0.0.444-ci (ModuelA has zero packages)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900