Load TileItem contents only when it is within the view area

5 posts, 0 answers
  1. Subarna Bandyopadhya
    Subarna Bandyopadhya avatar
    14 posts
    Member since:
    Apr 2005

    Posted 09 May 2011 Link to this post

    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
  2. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 11 May 2011 Link to this post

    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
  3. UI for WPF is Visual Studio 2017 Ready
  4. Chris
    Chris avatar
    23 posts
    Member since:
    May 2011

    Posted 26 Nov 2012 Link to this post

    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. 
  5. Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 29 Nov 2012 Link to this post

    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.

  6. Chris
    Chris avatar
    23 posts
    Member since:
    May 2011

    Posted 29 Nov 2012 Link to this post

    Thanks a lot
Back to Top
UI for WPF is Visual Studio 2017 Ready