开发者

How to create a 2 column menu list in WP7

开发者 https://www.devze.com 2023-02-17 09:51 出处:网络
I am trying to create a men开发者_运维知识库u list of image buttons, similar to the homescreen list, or the collection list in XBOXLive games app. Not sure what type of controls I need to use and how

I am trying to create a men开发者_运维知识库u list of image buttons, similar to the homescreen list, or the collection list in XBOXLive games app. Not sure what type of controls I need to use and how to structure them for a vertically scrolling list of items.


You could retemplate a ListBox (or similar) but it's probably simpler (you decide) to put the items in a WrapPanel (from the silverlight toolkit) inside a ScrollViewer.

This example uses buttons but you could use images or anything:

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

N.B. Actually, after testing the above, you probably don't want buttons and you'll need to be careful about selecting images while scrolling.

0

精彩评论

暂无评论...
验证码 换一张
取 消