Closed Spierki closed 8 years ago
var currentImage = Xamarin.Forms.ImageSource.FromStream(() => { return _originalStream; });
You can't do that. _originalStream
is disposed after first image loading operation (the same behavior is for standard Xamarin.Forms Image
. You must return a new stream instance every time (eg. create it from a byte array).
BTW: Did you try CachedImage.ReloadImage()
method?
@daniel-luberda In my Init method I already have the path of the picture too so I tried with the method:
var currentImage = Xamarin.Forms.ImageSource.FromFile(imagePath);
It's not working, same reason than with _originalStream?
I tried to use CachedImage.ReloadImage()
but I can't call this function, have you a sample ?
@Spierki The same problem, and I also use the XLabs.forms. So is there any solutions you have?
I don't understand. Could you elaborate?
Simple explanation is that var currentImage = Xamarin.Forms.ImageSource.FromFile(imagePath);
is giving you only a pointer to the file. You have to load it to the image view after that. Eg. cacheImage.Source = currentImage
;
Hello, I'm trying to use the library but I'm stuck because the image isn't reloading.
I used the mvvm pattern with the xlabs helpers.
This is my xaml file:
This is my view code:
In my viewmodel this is how I initialize my variables:
Then the reload method: