2014-09-28 41 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