开发者

Prism and Regions

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">
  <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="Main开发者_JAVA技巧ContentHeaderRegion" 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?


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜