リストボックスには、ImageおよびTextBlockコントロール付きのデータテンプレートが含まれています。私は最初のグリッドコンテナListBox内のDatatemplate内のコンテナは、リストが長すぎる場合はnullです。
<ListBox x:Name="NewsList" Margin="0,0,20,0" SelectionChanged="NewsList_SelectionChanged" />
<DataTemplate>
<Grid Width="400" Height="89">
<Image HorizontalAlignment="Left" Width="64" x:Name="ImageThumbnail" Height="64" VerticalAlignment="Top" Margin="0,10,0,0" Source="http://vnexpress.net/Files/Subject/3B/A2/3B/15/top.jpg"/>
<TextBlock Text="{Binding Title}" Margin="78,0,8,0" TextWrapping="Wrap" FontSize="26.667" Height="74" VerticalAlignment="Top"/>
</Grid>
</DataTemplate>
</ListBox>
for (int i = 0; i < feeds.Count; i++)
var containerItem = list.ItemContainerGenerator.ContainerFromIndex(i);
を取得することにより、ImageControlを取得したいと私はNewsList.Itemsを設定するとfeeds.Countが23以上であると=はcontainerItemのいくつかがnullの場合、フィード。それが23未満の場合、nullのコンテナは決して得られません。
原因と原因を知っている人はいますか?イメージコントロールを取得するための別の方法がある場合
の作品LowProfileImageコントロールを使用したDeferredLoadListBoxコントロール - http://blogs.msdn.com/b/delay/archive/2010/10/04/there-s-no-substitute-for-customer-feedback-improving-windows- phone-7-application-performance-now-a-bit-easy-with-lowprofileimageloader-and-deferredloadlistbox-updates.aspx – DevTheo
あなたの助けを大いに助けてくれませんか? – vodkhang