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>
問題是? –
@KooKiz此代碼不起作用! –