tags:

views:

45

answers:

1

0Hi

I have a shell in which i have a region "MainContentRegion" set. In that region i load this view:

<UserControl x:Class="CustomControls.MainContent"
       xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
       xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
       xmlns:cal="http://www.codeplex.com/CompositeWPF"&gt;
  <Border BorderThickness="1" BorderBrush="Black" Margin="2">
    <Grid x:Name="ContentGrid" Background="{StaticResource MainContentBackgroundColor}">
      <Grid.RowDefinitions>
        <RowDefinition Height="55" />
        <RowDefinition Height="*"/>
      </Grid.RowDefinitions>
      <ContentControl Name="MainContentHeaderRegion" cal:RegionManager.RegionName="MainContentHeaderRegion" Grid.Row="1"/>
      <ContentControl Name="MainContentBodyRegion" cal:RegionManager.RegionName="MainContentBodyRegion" Grid.Row="2"/>
    </Grid>
  </Border>
</UserControl>

When trying to access the 2 new added regions i get an error and after looking up the loaded regions i only see the regions added from the shell. Can someone help?

A: 

If the view containing the nested regions is loaded more than once that could cause an error as the nested regions would no longer be unique - in which case you should use a scoped region - see doc

Richard

related questions