I'm using the Composite Application Library with Silverlight, and I need to add three "zones" to my region. These "zones" all have essentially the same view and presentation model. (I'm getting these words from the StockTraderRI application. Correct me if I'm wrong.) The only difference I have is where I get the data from, so I want to have a different service for each "zone".
Currently, I am able to initialize my view in the "RightsRegion" by doing this:
public void Initialize()
{
RegisterViewsAndServices();
this.regionManager.Regions["MainRegion"].Add(new DefaultViewUI());
this.regionManager.RegisterViewWithRegion("RightsRegion", () => container.Resolve<ISecurityTreePresentationModel>().View);
}
private void RegisterViewsAndServices()
{
container.RegisterType<ITreeViewService, EntityTypesService>(new ContainerControlledLifetimeManager());
container.RegisterType<ISecurityTreeView, SecurityTreeView>();
container.RegisterType<ISecurityTreePresentationModel, SecurityTreePresentationModel>();
}
I thought I would be able to register another copy of this view in the "RightsRegion" with my LocationsService, but that seems to overwrite my EntityTypesService.
How can I register three identical views and very similar presentation models into my "RightsRegion" so that they each use a different service?