I have a listview which uses the following code:
<ListView x:Name="Display" ItemsSource="{Binding}" Background="#373737" Margin="0,0,350,0" BorderThickness="0" >
<ListView.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal" Width="767" Height="88">
<Border Height="64" Width="64" Margin="12,12,0,12">
<Image Source="{Binding Path=album.albumart}" Stretch="UniformToFill"/>
</Border>
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Margin="0,10,0,0">
<TextBlock Text="{Binding Path=name}"
Margin="10,0,0,0" Width="300" Height="40"
TextTrimming="WordEllipsis" TextWrapping="Wrap" FontSize="16" HorizontalAlignment="Left"/>
<TextBlock Text="{Binding Path=album.name}"
Margin="10,-15,0,0" Width="300" Height="20"
TextTrimming="WordEllipsis" HorizontalAlignment="Left"
FontSize="14" Opacity="0.49"/>
<TextBlock Text="{Binding Path=artistname}"
Margin="10,2,0,0" Width="300"
TextTrimming="WordEllipsis" HorizontalAlignment="Left"
FontSize="12" Opacity="0.49"/>
</StackPanel>
</StackPanel>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
And I have about 400 objects with images (this takes quite a bit of memory)
Which are then displayed in each listviewitem.
Is there any way for the listview to tell items to load their image from a cache I have based on which objects are visible in the listview instead of having all the images loaded all the time, which, as previously said takes quite a bit of memory.
Hope you guys understand what I'm on about, thank you.