-2
ScrollViewer
の性質上、次のようなことは実際にはできないと思っています。私は嘲笑てきた例ではスクロールビューワの中でウィンドウに合わせて要素を展開する
は、それがListView
に直接適用ScrollViewer
を失うことなく(可視ウィンドウが展開されている場合)、青Border
によって占有寸法を埋めるために展開するListView
を含むBorder
ために可能ですか?
パフォーマンス上の理由から、ListView
の高さは固定されていることが重要です(少なくとも起動時)。
XAML:
<Grid>
<ScrollViewer VerticalScrollBarVisibility="Auto">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<Border Grid.Row="0" Height="200" Background="Red"></Border>
<Border Grid.Row="1" Background="Blue"></Border>
<Border Height="200" Grid.Row="1">
<ListView ScrollViewer.VerticalScrollBarVisibility="Auto" FontSize="50" Background="Yellow">
<TextBlock>Hello</TextBlock>
<TextBlock>Hello</TextBlock>
<TextBlock>Hello</TextBlock>
<TextBlock>Hello</TextBlock>
<TextBlock>Hello</TextBlock>
</ListView>
</Border>
</Grid>
</ScrollViewer>
</Grid>