【发布时间】:2009-03-24 13:34:01
【问题描述】:
我有一个由页眉、主要内容和页脚构成的 shell 窗口。 主要内容是一个选项卡控件。 根据设计,其中一个选项卡项内容(用户控件)需要在页脚上方稍微扩展一点。 起初我考虑使用负边距来实现这一点,但无论我做什么,页脚总是被绘制在我的内容之上。
例如考虑以下 xaml:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="33*"/>
<RowDefinition Height="33*"/>
<RowDefinition Height="33*"/>
</Grid.RowDefinitions>
<StackPanel Background="Blue" Grid.Row="0"/> <!-- Header -->
<StackPanel Background="Red" Grid.Row="2"/> <!-- Footer -->
<TabControl Grid.Row="1" > <!-- Content -->
<TabItem>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="33*"/>
<ColumnDefinition Width="33*"/>
<ColumnDefinition Width="33*"/>
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="1" Background="Yellow" >
<Button Width="100" Height="50" Content="Text" />
</StackPanel>
</Grid>
</TabItem>
</TabControl>
我想要实现的是让黄色 StackPanel 以某种方式到达屏幕底部,重叠在红色页脚的顶部。
希望可以理解。 谢谢 爱丽儿
【问题讨论】: