I am encountering a problem using the method
this.regionManager.RegisterViewWithRegion("TextRegion", typeof(TextView));
If I write the above code in the boot tape in some way. This does not work because I cannot get the regionmanager object from the code
IRegionManager manager = this.Container.Resolve<IRegionManager>();
The above exception throws an exception "Exception message: current build operation (Build Key [Microsoft.Practices.Composite.Regions.IRegionManager, null]) failed: the current type, Microsoft.Practices.Composite.Regions. IRegionManager, is an interface and can't be constructed. Are you missing a type mapping? "
But on working on the code, I put it in some ViewModel and injected IRegionManager into it.
as
public HeaderControlViewModel(IEventAggregator aggregator, IRegionManager regionManager) : base(aggregator) { this.regionManager = regionManager; this.regionManager.RegisterViewWithRegion("TextRegion", typeof(TextView)); }
But I do not want to do this. I want everything to be configured with only the bootloader.
Please tell me why bootstrapper cannot get a RegionManager object? How can I solve this problem?
Thank you very much in advance...
source share