-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Image does not update after changing Image Uri #15
Comments
If we use |
Currently it is impossible to get the same effect as MAUI Image binding UriImageSource. Because ImageSource is not a BindableObject, when its source changed the ffimageloading:CachedImage can not get the notification to update the image. But why MAUI Image can? It use a tricky implementation. When Image's source property has been set, it will add a new event handler to the ImageSource's SourceChanged event. Then when the ImageSource's source property changed, it will notify the Image to change image. https://github.com/dotnet/maui/blob/main/src/Controls/src/Core/Image/Image.cs
But why FFImageLoading can not do like this? Because the ImageSource's SourceChanged is INTERNAL.
The walkaround is JUST to bind your ImageUrl to CachedImage's Source property. It will help you do all the other things.
|
Description
If we are using the
UriImageSource
then the image does not update when changing the Uri via a binding.If we use a regular
<Image>
control from MAUI.Controls with aUriImageSource
then changing the Uri does update the image, so this is a degradation from MAUI.Steps to Reproduce
XAML:
Code behind:
View Model:
Expected Behavior
When clicking the button to change the image Uri, the image should change.
Actual Behavior
The image does not change
Basic Information
The text was updated successfully, but these errors were encountered: