2013-08-06 9 views
8

मैं एक स्क्रॉलबार कैसे जोड़ सकता हूं जो मुझे क्षैतिज रूप से प्रदर्शित वस्तुओं के माध्यम से स्क्रॉल करने देता है?क्षैतिज आइटम स्क्रॉलिंग में स्क्रॉलिंग

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

उत्तर

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

यह जादू है। धन्यवाद –

संबंधित मुद्दे