Windows phone 7 如何通过代码指定图像在网格中的位置?
我们在xaml中所做的事情如下Windows phone 7 如何通过代码指定图像在网格中的位置?,windows-phone-7,windows-mobile,windows-phone-7.1,Windows Phone 7,Windows Mobile,Windows Phone 7.1,我们在xaml中所做的事情如下 <Image Height="136" HorizontalAlignment="Center" x:Name="image1" Stretch="Fill" VerticalAlignment="Center" Width="200" Grid.Row="0" Grid.Column="0" Source="/XYZ;component/Images/140-90.png" MouseLeftButtonDown="mouseLeftB
<Image Height="136" HorizontalAlignment="Center" x:Name="image1" Stretch="Fill" VerticalAlignment="Center" Width="200" Grid.Row="0" Grid.Column="0" Source="/XYZ;component/Images/140-90.png" MouseLeftButtonDown="mouseLeftButtonDown_Image1">
Grid.Row=“0”
和Grid.Column=“0”
是附加属性,因此您可以使用下一个代码来分配一些值:
image.SetValue(Grid.ColumnProperty, 0);
image.SetValue(Grid.ColumnProperty, 0);