2013-06-29 45 views
0

我需要做的標題和我的XAML鏈接的結合,這是我的代碼隱藏:綁定的windows phone C#

private void DownLoadCompleted(object sender, HtmlDocumentLoadCompleted e) 
      {    
       _popVideos = new List<PopularVideos>(); 
       var imgs = e.Document.DocumentNode.SelectNodes(@"//img[@src]") 
        .Select(img => new 
        { 
         Link = img.Attributes["src"].Value, 
         Title = img.Attributes["alt"].Value,   

        }).ToList(); 

       this.listBoxPopular.ItemsSource = imgs; 
      } 

我的XAML是這樣的:

<ListBox Name="listBoxPopular"> 
        <ListBox.ItemTemplate> 
         <DataTemplate> 
          <StackPanel> 
           <Image Name="imagem" Source="{Binding Path=alt}"/> 
           <TextBlock Text="{Binding Path=Title}" Tap="HyperlinkButton_Tap" Tag="{Binding Path=Url}" FontSize="30" Foreground="#FF159DDE" /> 
          </StackPanel> 
         </DataTemplate> 
        </ListBox.ItemTemplate> 
</ListBox> 
+0

問題是? –

+0

@KooKiz此代碼不起作用! –

回答

1

你檢查看看

IMGS

有東西在裏面。

+0

是的,他們正確地將所有標題和鏈接上傳到變量中的圖像。只是錯過抓住恰到好處。 –