2014-09-28 70 views

回答

0

您必须设置ItemPanelTemplate第一,试试这个

<ListBox x:Name="myLLS" ScrollViewer.HorizontalScrollBarVisibility="Visible"> 
    <ListBox.ItemsPanel> 
     <ItemsPanelTemplate> 
      <!-- here is where we change stuff --> 
      <StackPanel Orientation="Horizontal"></StackPanel> 
     </ItemsPanelTemplate> 
    </ListBox.ItemsPanel> 
    <ListBox.ItemTemplate> 
     <DataTemplate> 
      <Border BorderBrush="Red" BorderThickness="1,1,1,1"> 
       <StackPanel Height="100" Background="#FF00044D"> 
        <!-- Your Image collection from your ViewModel --> 
       </StackPanel> 
      </Border> 
     </DataTemplate>      
    </ListBox.ItemTemplate> 
</ListBox> 
+0

谢谢老兄其工作 – Madhu 2014-10-09 11:08:50