我有一个包含图像列表的类。Windows Phone绑定列表框Listbbx
public class RSSClass
{
public string Title { get; set; }
public string Summary { get; set; }
public string PubDate { get; set; }
public List<ImageData> ImagePath { get; set; }
public class ImageData
{
public Uri ImageLocation
{
get;
set;
}
}
}
赫斯的XAML
<ListBox Name="lstRSS">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel>
<StackPanel.Resources>
</StackPanel.Resources>
<TextBlock Text="{Binding Path=Title}"> </TextBlock>
<TextBlock Text="{Binding Path=PubDate}"></TextBlock>
<TextBlock Text="{Binding Path=Summary}"></TextBlock>
<ListBox x:Name="ImageListBox" ItemsSource="{Binding ImagePath}">
<DataTemplate>
<Image x:Name="image1" Source="{Binding}" MaxHeight="80" MaxWidth="120" Margin="0"></Image>
</DataTemplate>
</ListBox>
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
内部列表框,ImageListBox,结合并示出了URI的字符串值。我只是不知道如何绑定内部列表框image1中的图像?
任何帮助非常感谢。
问候 罗斯
您是否试过Source =“{Binding ImageLocation}”? – 2012-04-28 16:21:24
试过这个队友,没有运气,谢谢你的建议! – user746585 2012-04-28 16:34:17
您是否尝试过使用字符串作为ImageLocation而不是Uri? – 2012-04-28 17:08:49