{
if (!imagePropertyUpdatedFlag) return;
+ // Assume that we are using standard Image at first.
+ // (Since we might cache Visual.Property.Type as Visual.Type.AnimatedImage even we don't use URLs.)
+ using (PropertyValue imageType = new PropertyValue((int)Visual.Type.Image))
+ {
+ UpdateImage(Visual.Property.Type, imageType, false);
+ }
+
if (resourceURLs != null && resourceURLs.Count != 0)
{
using (PropertyArray indexPropertyArray = new PropertyArray())
// Trigger the ImageView so that we have something update
UpdateImage(ImageVisualProperty.URL, arrayProperty, false);
}
- }
- using PropertyValue animatiedImage = new PropertyValue((int)Visual.Type.AnimatedImage);
- UpdateImage(Visual.Property.Type, animatiedImage, false);
+ // Trick that we are using resourceURLs without ResourceUrl API.
+ using PropertyValue animatiedImage = new PropertyValue((int)Visual.Type.AnimatedImage);
+ UpdateImage(Visual.Property.Type, animatiedImage, false);
+ }
base.UpdateImage();
}
}
// Checkup the cached visual type is AnimatedImage.
- // It is trick to know that this code is running on AnimatedImageView.UpdateImage() / LottieAnimationView.UpdateImage() or not.
+ // It is trick to know that this code is running on AnimatedImageView.UpdateImage() with resourceURLs or not.
int visualType = (int)Visual.Type.Invalid;
- if (!((GetCachedImageVisualProperty(Visual.Property.Type)?.Get(out visualType) ?? false) && (visualType == (int)Visual.Type.AnimatedImage || visualType == (int)Visual.Type.AnimatedVectorImage)))
+ if (!((GetCachedImageVisualProperty(Visual.Property.Type)?.Get(out visualType) ?? false) && (visualType == (int)Visual.Type.AnimatedImage)))
{
// If ResourceUrl is not setuped, don't set property. fast return.
if (string.IsNullOrEmpty(_resourceUrl))
{
// Update-or-Insert new value
cachedImagePropertyMap[key] = value;
+ if (key == ImageVisualProperty.URL)
+ {
+ // Special case. If key is Url, update _resourceUrl here.
+ value.Get(out _resourceUrl);
+ }
}
}
}