【发布时间】:2012-03-28 08:33:24
【问题描述】:
我想在Image 控件的底部有一个DockPanel(不透明):DockPanel 宽度应该等于当前Image 宽度。
这是 XAML:
<Window
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Grid>
<Image Source="..." />
<DockPanel VerticalAlignment="Bottom" LastChildFill="True" Opacity="0.5">
<Button Content="Play" />
<ProgressBar Value="50" Maximum="100" Height="40" />
</DockPanel>
</Grid>
</Window>
使用此 XAML:DockPanel 的宽度不等于 Image 的宽度。 DockPanel 宽度设置为 Window 宽度。
【问题讨论】:
-
我缺少
Grid.Row="0"属性。