BitmapImage.UriSource binding doesn't work ...

来源:互联网 发布:网络大电影制作公司 编辑:程序博客网 时间:2024/05/22 08:08

最近做WPF开发中遇到很多怪事,越发感觉WPF不是一个足够成熟的技术。

 

如果你的代码中还有这样的绑定:

<BitmapImage UriSource="{Binding XPath=@Icon}" />

会在运行中遇到错误Property 'UriSource' or property 'StreamSource' must be set.

 

需要使用一个converter将URL对象转换成ImageSource,详见http://www.wiredprairie.us/journal/2007/03/bitmapimageurisource_binding_d.html

原创粉丝点击