I am having a problem getting my Telerik RadWindow to add modules to my module catalog. To get the RadWindow to load I had to override the Prism CreateShell method to return null.
protected override Window CreateShell() { //We must return null to override Window type.//return Container.Resolve<ShellWindow>();return null; }
I then handle all the initialization in the OnInitialized method.
protected override void OnInitialized() {
ShellWindow2 shellWindow = Container.Resolve<ShellWindow2>();
shellWindow.Show();
MainWindow = shellWindow.ParentOfType<Window>();
RegionManager.SetRegionManager(MainWindow, Container.Resolve<IRegionManager>());
RegionManager.UpdateRegions();
InitializeModules();
base.OnInitialized();
}
My problem is when I try to add modules to my Module Catalog I get an error : The region manager does not contain the MyRegion region.
protected override void ConfigureModuleCatalog(IModuleCatalog moduleCatalog) {
moduleCatalog.AddModule<SecurityModule>();
}
I think the problem is the module is trying to map to a region before the RegionManager is initialized in the OnInitialized method.
How can get the AddModule method to initialize after the RegionManager is set up?