开发者

Expression blend -- make a control repeat in a rectangular pattern

I've built a button in Blend. Now I want to make a grid开发者_如何学Go of my buttons -- say 4 across and 5 high. How can I do that?


There are a few possibilities.

1) If your grid is always 4x5 you could use a regular grid. Something like this:

<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="0.2*"/>
        <RowDefinition Height="0.2*"/>
        <RowDefinition Height="0.2*"/>
        <RowDefinition Height="0.2*"/>
        <RowDefinition Height="0.2*"/>
    </Grid.RowDefinitions>
    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="0.25*"/>
        <ColumnDefinition Width="0.25*"/>
        <ColumnDefinition Width="0.25*"/>
        <ColumnDefinition Width="0.25*"/>
    </Grid.ColumnDefinitions>
    <Button Content="Button" />             
    <Button Content="Button" Grid.Column="2"  Grid.Row="0"/>
    <Button Content="Button" Grid.Column="1" Grid.Row="1" />
</Grid>

2) The Silverlight for Windows Phone Toolkit contains a WarpPanel. You can give items in the WrapPanel a width and height and they're stacked together, like a 2D stackpanel. If the width of the wrappanel is changed, so are the amount of items on a row.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜