图像控制异步 [英] Image Control asynchronous

查看:125
本文介绍了图像控制异步的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我希望它在网络上异步加载图像的图像控制。我看到一些样品code在网络上说是这样的:

I have an image control that I want it to load the image asynchronously over the network. I see some sample code in the network saying something like:

<图像的Horizo​​ntalAlignment =左HEIGHT =118保证金=2,8,0,0VerticalAlignment =评出的WIDTH =167X:NAME =ImageThumbnail来源={结合SummaryImageLink,IsAsync = TRUE}/>

然而,在 Windows Phone 7的,我找不到这样的事情。有谁知道一个办法做到这一点没有我不得不code有很多我自己

However, in Windows Phone 7, I cannot find anything like that. Does anybody know a way to do that without I have to code a lot myself

推荐答案

不幸的是,你将不得不写,或包括多个code自己做这个正常。我第一次下载后的目标类似的解决方案来缓存图像。图片缓存类是通过访问的IValueConverter,所以一旦你已包括相应的​​code,你只需要Image对象上添加装饰:

Unfortunately you are going to have to write, or include, more code yourself to do this properly. I have a similar solution with the goal to cache images after the first download. The image cache class is accessed via a IValueConverter, so once you have included the appropriate code, you only have to add a decorator on the Image object:

<Image Source="{Binding ElementName=ImageSource, Path=Text, Converter={StaticResource imageCacheConverter}}" Width="200" />

在这里的全部细节和源$ C ​​$ C此处的 http://www.ben.geek.nz/2010/07/one-time-cached-images-in-windows-phone-7/

这篇关于图像控制异步的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆