我如何才能访问 longlistselector 项目。
我的 XAML 是:
<Grid x:Name="ContentPanel" Grid.Row="1" HorizontalAlignment="Left" Height="Auto" Margin="30,20,0,0" Grid.RowSpan="2" VerticalAlignment="Top" Width="420">
<phone:LongListSelector Name="longList" HorizontalAlignment="Left" Height="Auto" Margin="0" VerticalAlignment="Top" Width="420">
<phone:LongListSelector.ItemTemplate>
<DataTemplate>
<Grid Background="Transparent">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="210" />
<ColumnDefinition Width="210" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="160" />
</Grid.RowDefinitions>
<Image Name="first" Width="210" Margin="0" Source="{Binding ImageName}" Grid.Column="1" VerticalAlignment="Top" HorizontalAlignment="Left" />
<Image Name="second" Width="210" Margin="0" Source="{Binding ImageName}" Grid.Column="2" VerticalAlignment="Top" HorizontalAlignment="Right" />
</Grid>
</DataTemplate>
</phone:LongListSelector.ItemTemplate>
</phone:LongListSelector>
</Grid>
我想首先和第二次访问图像对象
我需要从包含ImageName字符串作为变量(保存 jpg 图像的路径)的类列表中连续分配这两个图像对象的源,然后将下两个图像对象分配到下一行,依此类推..