RegionManager Problem

Jul 20, 2015 at 12:29 PM
First of all: great work, congratulation!!! Your RibbonRegionAdapter has saved me a lot of work.

I had some problems to configure it, because of the regionManager call that you suggest:
_regionManager.RegisterViewWithRegion(ShellRegions.Ribbon, typeof(Views.Ribbon));
Finally I removed it, and call directly to the Initialize method of the adapter, in this way:
RegionAdapter regionAdapter = this.container.Resolve<RibbonRegionAdapter>();
MainWindow mainWindow = this.container.Resolve<MainWindow>();
Region region = regionAdapter.Initialize(mainWindow.MainMenu, "NewMainMenu");
region.Add(view, "MenuBar");
Why did I do that? Because with the suggested way the Adapt() method was not fired, and so the ribbons were not merged. This way it works fine.

The question is, why do I need to do that? Is there a better way to do it?

Similar question here:

Thank you