在Windows Phone7中存在著多個容器控制項,這些控制項主要是用來介面的布局設定,以及包容多個控制項時的布局設定。
一.Grid控制項:主要用於介面的布局,這個和web page裡的很相似,可以通過網格布置規劃介面,也可以嵌套使用。
<Grid x:Name="ContentGrid" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="159*" />
<ColumnDefinition Width="141*" />
<ColumnDefinition Width="180*" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="134*" />
<RowDefinition Height="133*" />
<RowDefinition Height="220*" />
<RowDefinition Height="162*" />
</Grid.RowDefinitions>
<Image Height="110" HorizontalAlignment="Left" Margin="20,16,0,0" Name="image1" Stretch="Fill" VerticalAlignment="Top" Width="131" Source="/MyPhoneTest;component/Images/Chrysanthemum.jpg" />
<Image Grid.Column="1" Grid.Row="1" Height="105" HorizontalAlignment="Left" Margin="13,12,0,0" Name="image2" Stretch="Fill" VerticalAlignment="Top" Width="115" Source="/MyPhoneTest;component/Images/Desert.jpg" />
<Image Grid.Column="2" Grid.Row="2" Height="150" HorizontalAlignment="Left" Margin="14,51,0,0" Name="image3" Stretch="Fill" VerticalAlignment="Top" Width="154" Source="/MyPhoneTest;component/Images/Hydrangeas.jpg" />
</Grid>
</Grid>