In reviewing the View Injection quickstart, the projectlist view is injected into the employee details region. The coordination between the employee module and the projectlist module is handled in the EmployeeController class.
here's the snippet
public virtual void OnEmployeeSelected(BusinessEntities.Employee employee)
IRegion detailsRegion = regionManager.Regions[RegionNames.DetailsRegion];
object existingView = detailsRegion.GetView(employee.EmployeeId.ToString(CultureInfo.InvariantCulture));
if (existingView == null)
IProjectsListPresenter projectsListPresenter = this.container.Resolve<IProjectsListPresenter>();
IEmployeesDetailsPresenter detailsPresenter = this.container.Resolve<IEmployeesDetailsPresenter>();
IRegionManager detailsRegionManager = detailsRegion.Add(detailsPresenter.View, employee.EmployeeId.ToString(CultureInfo.InvariantCulture), true);
IRegion region = detailsRegionManager.Regions[RegionNames.TabRegion];
The fact the Employee Controller is referencing the IProjectsListPresenter interface represents tighter coupling between the modules. Should there be a controller that sides outside the employee and projectlist modules, that can respond to a public
event from the employeeList presenter when an employee is selected?
Sorry if this is off-base, I'm trying to wrap my brain around the scoping and levels of control.