My program requires loading a large set of images within one scrollable view (around 1K)
My code:
<ScrollViewer>
<VirtualizingStackPanel Orientation="Vertical"> <!-- Stack panel of stack panels -->
<StackPanel Orientation="Horizontal">
<local:Widget Text="1" Image="https://exaple.com/" /> <!-- local class purpose of is placing image and text in one line -->
<local:Widget Text="1" Image="https://exaple.com/" />
<local:Widget Text="1" Image="https://exaple.com/" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<local:Widget Text="1" Image="https://exaple.com/" />
<local:Widget Text="1" Image="https://exaple.com/" />
<local:Widget Text="1" Image="https://exaple.com/" />
</StackPanel>
...
</VirtualizingStackPanel>
</ScrollViewer>
Problem is that before launching wpf goes to every website and downloads all images at once, how can I say wpf to download and show them on user seeing them?
---- EDIT
I have pinpointed the issue with scrollviewer demanding everything all at once, either I use CanContentScroll
or not, I also tried using ListBox
with VirtualizingPanel.ScrollUnit="Pixel"
, but it also did not work, still looking for answer