【发布时间】:2018-12-28 15:59:36
【问题描述】:
我不知道如何让 itemControl 的项目激活项目控件的水平滚动条。我的情况是只有一个项目。当 itemSource 中存在多个项目时,会出现滚动条。但是项目模板的构建方式是,每个项目都足够长以超出父项的宽度。我假设我需要使用 Pixel 作为我的滚动单元,但这并没有什么不同。
<ItemsControl Grid.Row="1" ItemsSource="{Binding LAndUDataPoints[0].Models, Mode=OneWay}" HorizontalContentAlignment="Stretch" ItemTemplate="{StaticResource LAndUItemTemplate}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate >
<VirtualizingStackPanel Orientation="Horizontal" ScrollUnit="Pixel" />
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
</ItemsControl>
【问题讨论】:
标签: xaml itemscontrol