Hi Greg,

 

I've never done one, but it doesn't sound too hard.  Just have an Image
property that uses INotifyPropertyChanged on your bound objects for the
rows.  Have a default image in that property.  Have a background process
that loads the images into the property; the datagrid should look after
the rendering itself.

 

The fun part would be the background loading; you probably want a
central service that you register each row's model with that will load
the appropriate property with the appropriate image.  I'm guessing
keeping it central will help as you'll probably want to throttle the
number of processes accessing the disk etc.

 

Carl.

 

PS - is this now the Greg/Patrick/Carl list?  *grin*

 

Carl Scarlett

Senior .NET/WPF Developer, UX Designer | Genesis

Enterprise Services | Bankwest

A: Level 3, Home Zone 3B, 300 Murray Street | Perth | Western Australia
| 6000

P: (08) 9369 5161

M: 0408 913 870

E: [email protected] <mailto:[email protected]> 

 

Description: cid:[email protected]

 

 

 

From: [email protected] [mailto:[email protected]]
On Behalf Of Greg Keogh <[email protected]>
Sent: Sunday, 2 September 2012 4:33 PM
To: "'ozWPF'" <[email protected]>
Subject: Lazy loading images

 

Folks, I have a need to lazily load image thumbnails for display in
DataGrid rows. I need that sort of effect you see in Windows Explorer
tile view where the items appear instantly but the images progressively
load and render.

 

Before I start coding this from scratch I thought it might be worth
asking if anyone has experience in this sort of thing. In my case, the
full sized (~4MB) images are in a folder and I cache thumbnails of
different sizes in another common folder location. I have an old
WinForms app that generates and uses these cached thumbnails and it
works nicely. Now I have to do the same thing in WPF and try to do it
with binding in a way that doesn't "fight the system".

 

I have a few handy MarkupExtension classes already that replace strings
and icons in the XAML. Perhaps I could write a "smarter" one that lazy
loads images, but I'm not sure how the asynchronous arrival of the image
would update the UI, nor is it clear how pending loads would be
cancelled if the user navigates away to a different screen.

 

Anyway, comments on this general issue would be welcome, before I hoe
into the coding and possibly waste time.

 

Greg


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud
service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

_______________________________________________ 
ozwpf mailing list 
[email protected] 
http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf 

________________________________________________________________________
_______ 

This email has been scanned by the Bankwest Email Security System. 
________________________________________________________________________
_______ 

_______________________________________________________________________________
Unencrypted electronic mail is not secure and may not be authentic.
If you have any doubts as to the contents please telephone to confirm.

This electronic transmission including any attachments is intended only
for those to whom it is addressed. It may contain copyright material or
information that is confidential, privileged or exempt from disclosure by law.
Any claim to privilege is not waived or lost by reason of mistaken transmission
of this information. If you are not the intended recipient you must not
distribute or copy this transmission and should please notify the sender.
Your costs for doing this will be reimbursed by the sender.

We do not accept liability in connection with computer virus, data corruption,
delay, interruption, unauthorised access or unauthorised amendment.
_______________________________________________________________________________


______________________________________________________________________
This email has been scanned by the Symantec Email Security.cloud service.
For more information please visit http://www.symanteccloud.com
______________________________________________________________________

<<inline: image001.png>>

_______________________________________________
ozwpf mailing list
[email protected]
http://prdlxvm0001.codify.net/mailman/listinfo/ozwpf

Reply via email to