WP7 / Silverlight] Linking deleted images in a list, so the user interface does not block

(Scenario: Windows Phone 7 / Silverlight)

I have a ListBox which I will simplify for this XAML:

<ListBox ItemsSource="{Binding Path=ImageLinks}"> <!-- ImageLinks a collection in ViewModel -->
    <ListBox.ItemTemplate>
                <DataTemplate>
                    <Image Source="{Binding Path=ImageSource}" /> <!-- ImageSource is a string with the url to the image-->
                </DataTemplate>
    </ListBox.ItemTemplate>
</ListBox>

Now the code above works, but the problem is that when rendering / loading an item or loading an image, but it blocks the user interface. And since more than one element is suitable at this time, the user interface is blocked until all relevant images have been loaded.

So, the question is how can I get this functionality without blocking the user interface when loading images (and avoid re-loading all of them every time I move the view) .

.

, . , , .

+3

Source: https://habr.com/ru/post/1765855/


All Articles