1
如何訪問longlistselector項目。如何訪問Windows Phone 8中的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>
我想要得到的圖像的訪問對象第一 & 第二
我需要從包含類的列表中指定這兩個圖像對象的源圖像名稱字符串作爲變量(保存jpg圖像的路徑)連續,然後下兩行到下一行等。
我只需要需要首先設置圖像源。 – Abhishek 2013-03-12 04:17:57
此演示將向您展示如何在WP8中填充longlistselector。http://www.geekchamp.com/articles/the-new-longlistselector-control-in-windows-phone-8-sdk-in-depth – 2013-03-12 07:17:00