【问题标题】:How to remove Region and add new ContentControls from Module如何从模块中删除区域并添加新的 ContentControls
【发布时间】:2010-06-07 08:38:04
【问题描述】:

我在 Shell "LoginRegion" 中只设置了一个区域

<!-- Login Region -->
<Border Grid.Row="0">
    <ContentControl x:Name="LoginRegion" Regions:RegionManager.RegionName="LoginRegion"
                        VerticalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"/>
</Border>

登录成功后,我需要从登录模块后面的代码中删除“LoginRegion”并将具有新LayoutRoot网格定义的其他3个区域添加到Shell。

<Grid.RowDefinitions>
    <RowDefinition Height="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>

请帮忙,谢谢。

【问题讨论】:

    标签: c# silverlight silverlight-4.0 region prism-2


    【解决方案1】:

    看看这个来自 Ron Gramann:

    http://www.codeproject.com/KB/WPF/PrismLayoutManager.aspx

    Prism v2 的布局管理器

    对我有用

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2016-07-29
      • 1970-01-01
      • 2022-09-08
      • 1970-01-01
      • 2011-01-30
      • 2022-01-07
      • 2021-01-15
      • 2012-09-17
      相关资源
      最近更新 更多