我有一个带有数据模板的列表框。问题是它期望源是一个字符串。我拥有的字符串是 xap 文件中图像的 uri。所以它将是 uri(xxx, uri.relative) 由于我只能使用字符串值,我如何让它在 xap 文件中查看图像?
ListBox.ItemTemplate
DataTemplate
StackPanel Orientation=Horizontal VerticalAlignment=Center
Image Source="{Binding Path=Image}" Width="50" Height="50" Margin="0,0,10,0"
StackPanel
DataTemplate
ListBox.ItemTemplate
//it won't let me use URI for the Image return value!!!
public class MyListboxItem
{
public String Image
{
get { return thumb;
}
}