0
我有一个带有扩展器的ListBox,它又包含一个ListBox。 我希望ListBox和Expanders(listBox1)以及每个Expander(listBox2)中的ListBox都具有滚动功能,但我无法让最内层的滚动工作(即我的XAML中的scrollViewer1)。扩展器中的滚动查看器
我怎样才能让两个滚动条工作?
<ScrollViewer x:Name="scrollViewer1">
<ListBox x:Name="listBox1" ItemsSource="{Binding Data}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<Expander>
<Expander.Header>
<TextBlock Text="{Binding Name}">
</TextBlock>
</Expander.Header>
<ScrollViewer x:Name="scrollViewer2">
<ListBox x:Name="listBox2" ItemsSource="{Binding Numbers}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<Grid>
<TextBlock Grid.Column="0" Text="{Binding}"/>
</Grid>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</ScrollViewer>
</Expander>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
一切,你闯到大的
谢谢!当窗口调整大小时,如何让listBox2将其高度调整为适合窗口的大小? – aengas