I am developing a WPF desktop application using prism 4 framework. In my application i show a list employees and when one is is selected from the the list the details of the selected employee is shown in details region. in side my controller for responding to employee selected event i have the following code for injectiong the EmployeeDetailsVeiw.
IRegion employeeDetailsVeiwRegion = this.regionManager.Regions["EmployeeDetailsVeiwRegion"];
EmployeeDetailsView view = employeeDetailsVeiwRegion.GetView("EmployeeDetailsVeiw") as EmployeeDetailsView;
if(view == null)
{
view = this.container.Resolve<EmployeeDetailsView>();
employeeDetailsVeiwRegion.Add(view, "EmployeeDetailsVeiw");
}
I have define the region as
<ContentControl Name="EmployeeDetailsVeiwRegion" Margin="16" Grid.Row="1"
prism:RegionManager.RegionName="EmployeeDetailsVeiwRegion"/>
But when i run the code i keep getting the error
The region manager does not contain the EmployeeDetailsVeiwRegion region
Attempted Solution
I have tried out the solution proposed in other stack over plow posts such as here a link and other posts, but it is not working for me.