artem-zinnatullin / jet-image-loader

WP7+ fast and powerfull image loader with memory and storage caching for your projects!
Apache License 2.0
44 stars 14 forks source link

Screen is flickering once presses back button #11

Open its-veejay opened 10 years ago

its-veejay commented 10 years ago

I found one more issue and below is the scenario to replicate it, please have a look on it.

Step 1: Bind a List with Data Template

```


Step 2: On press of any list item image click it will show some other Panorma Item and once user press back button to see the list of images it will bind the list and while binding images from cache it Flicker and looks annoying as per user prospective.
artem-zinnatullin commented 10 years ago

Oh yeah, I faced that issue in my app. But problem is not in JetImageLoader.

You need to check ImageUri property for equality and call NotifyPropertyChanged() only if new value is not equals to previous.

Example of List item model (pseudo C#):

public class ListItemExample
{
    private string _imageUri;

    public string ImageUri
    {
            get { return _imageUri; }
            set
            {
                if (!String.Equals(value, _imageUri))
                {
                    _imageUri = value;
                    NotifyPropertyChanged();
                }
            }
    }
}

Do not call NotifyPropertyChanged() if image uri value was not changed because it will call JetImageLoader and it will do his work :)

artem-zinnatullin commented 10 years ago

May be I need to write that in help or example, thank you for the feedback :)