图像源绑定不会在Xamarin Forms中的ListView内部更新

时间:2017-03-23 05:51:11

标签: listview mvvm xamarin.android xamarin.forms

我有一个listview,里面有自定义viewcell,viewcell有图像控件绑定到ImageFile属性

<ffimageloading:CachedImage
             Grid.RowSpan="3"
             VerticalOptions="FillAndExpand"
             HorizontalOptions="FillAndExpand"
             DownsampleToViewSize="True"
             Source="{Binding ImageFile, Converter={StaticResource byteToImage}}"
             Aspect="AspectFit">
          <ffimageloading:CachedImage.GestureRecognizers>
            <TapGestureRecognizer NumberOfTapsRequired="1" Tapped="OnTakePicture"/>
          </ffimageloading:CachedImage.GestureRecognizers>
        </ffimageloading:CachedImage>

OnImage点击我正在更改ImageFile源,但Ui没有反映

注意: - 当我向下滚动并返回时,它会反映更新的图像。

请提供解决方案以解决此问题。

1 个答案:

答案 0 :(得分:0)

这很奇怪,但问题是MvvmCross属性改变了事件......

我在我的项目中使用MvvmCross作为mvvmhelper,但似乎MvxViewModel在notifyproperty更改事件时表现不佳。

我已经简单地用我的自定义INotifyPropertyChanged接口实现了,这个问题已经解决了