【发布时间】:2011-06-10 04:28:49
【问题描述】:
我正在使用 Silverlight,在我的 xaml 中,我尝试将图像源与 StringFormat 绑定,就像WPF Image Dynamically changing Image source during runtime 中的示例一样
但是当我添加 '&'在我的网址中有一个错误说: System.FormatException 在“ProductView.xaml”上引发:索引(从零开始)必须大于或等于零且小于参数列表的大小。
这是我的图片标签 i xaml:
<Image Width="100" Height="100" Source="{Binding Image.ResourceFileId, StringFormat='http://URL/images?id={0}&format=thumbnail'}" />
删除“&”部分时没有错误,应用程序在有和没有“&”部分的情况下都可以编译和运行。这只是设计器中的一个错误,但效果是当此错误“活动”时,IntelliSense 似乎不再起作用。
有人对此有解释吗?
【问题讨论】:
标签: silverlight visual-studio-2010 data-binding string-formatting