I'm creating a new WPF with MEF and it works nice.
But now I need to create a new Window with a Region but it seems like the region is not registered. However the Regions created in the Window (shell) are registered.
Here's the code for the new Window
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" DockPanel.Dock="Bottom">
<Button Content="_Previous" Margin="0, 0, 10, 0" />
<Button Content="_Next" />
<ContentControl cal:RegionManager.RegionName="WizardStepsRegion" />
When I try to get the view inside the region I get the following exception "KeyNotFoundException was unhandled by user code", "The region manager does not contain the WizardStepsRegion region."
private void Window_Closing(object sender, System.ComponentModel.CancelEventArgs e)
object asdf = regionManager.Regions["WizardStepsRegion"];//.GetView("Step1View");
Can someone help me to fix this?