c# - Lazy loading images in Virtualized Listbox -


I'm trying to lazy load thumbnail image for each item in a listbox asynchronously.

  & lt; Image Source = "{Binding Path = thumbnail target Nilevlugh = {static resource Aisim}}" />  

An item display port since the listbox called Greater virtual thumbnail property Only when or in that is near.

  get public BitmapSource thumbnail {TriggerLoad (); Return _ thumbnail; }}  

I really does operation that load thumbail in TriggerLoad event, but the UI is very sensitive, especially not when you try to scroll quickly through the list of items I am waiting for

  Private async zero TriggerLoad () {if (LoadTriggered) {LoadTriggered = true; Var cacheItem = _cache [key] as CacheItem; If (cacheItem! = Null) await LoadBitmapFromCache (cacheItem); // gives a task and waits for the loaded bitmapfo service (id); // gives a function}}  

Similar questions have been received but it is not about loading objects in a listbox? Any better approach to lazy loading there is just a part of the data you bound to the listbox.

Edit: I tried PriorityBinding and IsAsync option and scroll is not better than my current solution

think try to set Warchualaijeshnmod for recycling and a long cash Lalenment set Please.

  & lt; ListBox ... VirtualizingPanel.IsContainerVirtualizable = "right" VirtualizingPanel.IsVirtualizing = "right" VirtualizingPanel.VirtualizationMode = "Recycling" VirtualizingPanel.CacheLengthUnit = "page" VirtualizingPanel.CacheLength = "2: So as 2" etc / & gt; "2" 2 "page" (or worthable view-port of the item) means "111" before increasing the CacheLength and after displaying the page in memory Your app will consume more memory than it will be loaded for the user, but users will be able to scroll quickly, before they run in the images being loaded. 


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -