I would like to know what is the best way to show a loading animation while downloading an image.
I have an image which is loaded dynamically from an internet URL. So I have about 1/2 second before seeing my image and i think it depends of the connection. So I would like to show an animation for the user while the image is still downloading.
Tanks for your suggestions
I finally solved my problem by using the VM (MVVM). I explain if someone have the same kind of trouble :
First I have Listbox in my view which is connected to a List in my ViewModel. What I did is connect a command to the event SelectionChanged like this :
Then in my function Load cover, I construct the url of the cover and I create a bitmapImage. But before, I initialize a boolean to say it’s loading :
Finally when the image is download i put the loading indication to false.
And in my View, my control is only visible when IsLoadingCover is true (Bool to Visibility Converter) :