This is a migrated thread and some comments may be shown as answers.

Load TileItem contents only when it is within the view area

4 Answers 91 Views
TileView
This is a migrated thread and some comments may be shown as answers.
Subarna Bandyopadhya
Top achievements
Rank 1
Subarna Bandyopadhya asked on 09 May 2011, 01:03 PM
My tileView has tileItems that have an image thumbnail along with other things. The process that loads these images is a time-taking process. I want to load the image thumbnails only if the Tile item is within the viewable area. So if my current viewarea shows 50 tile items out of 100 tile items, I want to load the images for only those 50 that are visible. When the user scrolls the tileview and other tileitems come into view, then I want to load the images for these tileitems too.

Is there any event that I can use, to call my load image code....maybe something like tileitem post rendering or something.
I will be grateful for any code samples.
Thanks,
Subarna

4 Answers, 1 is accepted

Sort by
0
Zarko
Telerik team
answered on 11 May 2011, 04:30 PM
Hello Subarna Bandyopadhya,
Have you tried to use the Virtualization of the RadTileView? In its concept the virtualization works like this - you have to set some RowHeight and/or ColumnWidth to the RadTileView (so that not all items are inside the viewable area), turn it on by setting the IsVirtualizing property to True and then when you start your application the RadTileView will generate only the items that are visible.
For further references could you please examine the attached project (to see the difference just set the IsVirtualizing to false) and if you have more questions feel free to ask.

Greetings,
Zarko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Chris
Top achievements
Rank 1
answered on 26 Nov 2012, 08:03 PM
In RadTileView virtualization scenario, how to get a notification of a item which no longer in the view.  We are controlling the memory usage of our application, since each item contains image and the image is generated on demand (by UI), but once it created, it stay in the viewmodel. We would like to receive an event to know if a item is no longer in the view, so we can dispose the image.

Thanks. 
0
Zarko
Telerik team
answered on 29 Nov 2012, 04:26 PM
Hi Chris,
Unfortunately there's no straightforward way to do this but there are two possible workarounds:
- inherit our RadTileView and RadTileViewItem and add some IsItemLoaded dependency property to the item so that you could bind to it.
- create an attached property and do the same - handle Loaded and Unloaded events and notify the business item.
I've attached a sample project showing the second workaround so could you please examine it and if you have further questions feel free to ask.

Kind regards,
Zarko
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Chris
Top achievements
Rank 1
answered on 29 Nov 2012, 05:57 PM
Thanks a lot
Tags
TileView
Asked by
Subarna Bandyopadhya
Top achievements
Rank 1
Answers by
Zarko
Telerik team
Chris
Top achievements
Rank 1
Share this question
or