如何添加滚动条,让我在水平显示的项目中滚动?
<ItemsControl ItemsSource="{Binding Data, ElementName=myWindows}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal">
</VirtualizingStackPanel>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<ItemsControl.ItemContainerStyle>
<Style TargetType="FrameworkElement" >
<Setter Property="Margin" Value="10,0,10,0"></Setter>
</Style>
</ItemsControl.ItemContainerStyle>
</ItemsControl>发布于 2013-08-06 17:18:27
<ItemsControl ItemsSource="{Binding Data, ElementName=myWindows}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="Horizontal"/>
</ItemsPanelTemplate>
</ItemsControl.ItemsPanel>
<!-- Add this Template -->
<ItemsControl.Template>
<ControlTemplate TargetType="ItemsControl">
<ScrollViewer HorizontalScrollBarVisibility="Visible">
<ItemsPresenter/>
</ScrollViewer>
</ControlTemplate>
</ItemsControl.Template>
<!-- ... Etc ... -->
</ItemsControl>https://stackoverflow.com/questions/18086434
复制相似问题