I've set only one region in Shell "LoginRegion"
<!-- Login Region -->
<Border Grid.Row="0">
<ContentControl x:Name="LoginRegion" Regions:RegionManager.RegionName="LoginRegion"
VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"/>
</Border>
And after login succeeded, I need to remove "LoginRegion" and add 3 other regions with new LayoutRoot
grid definitions to Shell from code behind in Login module.
<Grid.RowDefinitions>
<RowDefinition H开发者_JAVA百科eight="93"/>
<RowDefinition />
<RowDefinition Height="24"/>
</Grid.RowDefinitions>
<!-- Top Region -->
<Border Grid.Row="0">
<ContentControl x:Name="TopRegion" Regions:RegionManager.RegionName="TopRegion"
VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"/>
</Border>
<!-- Main Region -->
<Border Grid.Row="1">
<ContentControl x:Name="MainRegion" Regions:RegionManager.RegionName="MainRegion"
Style="{StaticResource TestStyle}"
VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"/>
</Border>
<!-- Bottom Region -->
<Border Grid.Row="2">
<ContentControl x:Name="BottomRegion" Regions:RegionManager.RegionName="BottomRegion"
VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"/>
</Border>
Please help, thank you.
look at this from Ron Gramann:
http://www.codeproject.com/KB/WPF/PrismLayoutManager.aspx
Layout Manager for Prism v2
it works for me
精彩评论