1
我正在构建一个SL 4应用程序。用户界面由三个主要部分组成:顶部搜索栏,底部最喜欢栏以及两者之间的页面内容。我希望页面内容占用所有可用空间。现在,它横向扩展,但不是垂直扩展。我不确定我做错了什么。这里是XAML:Silverlight:如何让此控件占用所有可用空间?
<Grid x:Name="LayoutRoot" Background="BurlyWood">
<Grid.RowDefinitions>
<RowDefinition />
<RowDefinition />
<RowDefinition />
</Grid.RowDefinitions>
<my:TopSearchBar x:Name="topSearchBar" Grid.Row="0" Navigator="{Binding ElementName=navigationFrame}" HorizontalAlignment="Stretch" VerticalAlignment="Top" />
<!-- I want this to take up all available space between the bottom and top elements -->
<navigation:Frame x:Name="navigationFrame" Source="/HomePage.xaml" Grid.Row="1" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Background="BlueViolet" />
<my:BottomFavoritesBar x:Name="bottomFavoritesBar" Grid.Row="2" Navigator="{Binding ElementName=navigationFrame}" HorizontalAlignment="Stretch" VerticalAlignment="Bottom" />
</Grid>
我能做什么错?
是不是`Height =“Auto”隐式? – 2010-11-23 20:16:04
自动是隐含的,但重要的部分是“*”列。这告诉它占用所有可用空间。如果没有这3列将是自动的,这意味着内容所需的最低限度。 – Stephan 2010-11-23 20:31:40