在 Windows Phone 8.1 应用程序中加载时显示占位符图像

Showing placeholder image while loading in Windows Phone 8.1 app

我想在我的 Windows Phone 8.1 应用程序中显示占位符静态图像,同时从网络异步加载图像。

<Image Name="productImage" Source="{Binding ImgUrl}" />

图像位于 DataTemplate 的 ListView 中。 如何知道图片加载完毕,隐藏静态图片?

如果对性能要求不高,可以将两张图片叠放:

<Grid>
    <Image Source="The Background Image" />
    <Image Source="{Binding ImageUrl}" />
</Grid>

您下载的图片会在加载后叠加在背景上。

只有当您的图片具有固定尺寸时才会看起来不错。