2013-08-06 33 views
8

Yatay olarak görüntülenen öğeler arasında gezinmemi sağlayan kaydırma çubuğunu nasıl ekleyebilirim?Yatay olarak kaydırma ItemsControl

<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> 

cevap

16
<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> 
+2

Bu büyüdür. Teşekkürler –