【发布时间】:2017-07-25 21:17:58
【问题描述】:
我正在尝试仅使用 XAML 和视图模型在 ListView 中使用 FFImageLoading。对于列表中的每个项目,我都有一个模型,我想在图像无法加载和更新与同一模型中的图像关联的标签时进行陷阱。
<ffimageloading:CachedImage
DownsampleToViewSize="true"
RetryCount="0"
ErrorCommand="{Binding ImageLoadError}"
IsVisible="{Binding HasAttachement}"
Source="{Binding Attachment}">
</ffimageloading:CachedImage>
我认为添加一个绑定在我的模型中的 ErrorCommand 处理程序会起作用,除非该命令正在为我的模型的每个实例调用,而不仅仅是图像加载失败的实例
ImageLoadError = new Command((e) =>
{
Debug.WriteLine($"Image load error Text is {Text}");
});
我的模型的每个实例都会调用上述命令处理程序,而不仅仅是附加到失败图像的实例。
如何才能将加载错误通知仅发送到与图像关联的模型实例?
【问题讨论】:
标签: xamarin.android xamarin.forms ffimageloading