【发布时间】:2017-04-22 09:06:20
【问题描述】:
我正在尝试将 EmbeddedImages 绑定到 ListView,以便可以根据列表项显示不同的图标。使用Working with Images 教程,我设法制作了一个扩展来显示嵌入的图像,但前提是我将位置硬编码为图标。
所以这行得通:
<Image Source="{local:ImageResource (namespace).icon.png}"/>
但我无法绑定到我想要的图标。我已经尝试了所有这些,但都没有奏效:
<Image Source="{local:ImageResource {Binding _iconLocation}}" />
<Image Source="{Binding Source=local:ImageResource, Path=_iconLocation}"/>
【问题讨论】: