2011-03-15 56 views
1

我想創建一個圖像按鈕的菜單列表,類似於主屏幕列表或XBOXLive遊戲應用程序中的收藏列表。不知道我需要使用哪種類型的控件,以及如何爲垂直滾動的項目列表構造它們。如何在WP7中創建2列菜單列表

回答

1

你可以retemplate一個ListBox(或類似),但它可能是更簡單的(決定)把項目的WrapPanel(從silverlight toolkit)一個ScrollViewer內。

此示例使用按鈕,但你可以使用圖片或任何東西:

<Grid x:Name="ContentPanel" Grid.Row="1" Margin="12,0,12,0"> 
    <ScrollViewer> 
     <toolkit:WrapPanel> 
      <Button Width="200" Height="200" Content="option1"/> 
      <Button Width="200" Height="200" Content="option2"/> 
      <Button Width="200" Height="200" Content="option3"/> 
      <Button Width="200" Height="200" Content="option4"/> 
      <Button Width="200" Height="200" Content="option5"/> 
      <Button Width="200" Height="200" Content="option6"/> 
      <Button Width="200" Height="200" Content="option7"/> 
      <Button Width="200" Height="200" Content="option8"/> 
      <Button Width="200" Height="200" Content="option9"/> 
     </toolkit:WrapPanel> 
    </ScrollViewer> 
</Grid> 

注:實際上,經過上述測試之後,您可能不需要按鈕,並且在滾動時需要小心選擇圖像。