I'm developing an WPF application with PRISM 5.0.
At some point I want to deactivate all active views in specific region.
IRegion contentRegion = _regionManager.Regions
.First(region => region.Name == RegionNames.ContentRegion);
foreach (object view in contentRegion.ActiveViews)
{
contentRegion.Deactivate(view);
}
But at this point I get an exception:
System.InvalidOperationException was unhandled by user code
HResult=-2146233079
Message=Deactivation is not possible in this type of region.
Source=Microsoft.Practices.Prism.Composition
StackTrace: ...
InnerException:
My region is only declared at base view Shell.xaml as
<Border Grid.Column="1" BorderBrush="#193441" BorderThickness="2,2,2,2">
<ContentControl regions:RegionManager.RegionName="ContentRegion" />
</Border>