【发布时间】:2014-07-16 06:45:16
【问题描述】:
我在flyout 和flyout 中有一个ListView,就像StackPanel 有无限的高度,所以ListView 失去了虚拟化。
<Flyout Placement="Full">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<TextBlock Grid.Row="0" Text="All Players" Margin="12"/>
<ListView Grid.Row="1" Margin="12"/>
</Grid>
</Flyout>
我可以给 Grid 一个固定的Height = 500,但它可能会因不同的分辨率而改变。
我需要获取页面高度并将其设置为绑定,但我不知道如何获取它!
如何限制 ListView 的高度?
【问题讨论】:
-
您可以使用 {Binding Height, UpdateSourceTrigger=PropertyChanged}"
标签: c# xaml windows-phone-8 windows-runtime windows-phone-8.1