Memory consumption with large set of MultiScaleImages

2 posts, 0 answers
  1. tobmatth
    tobmatth avatar
    1 posts
    Member since:
    Feb 2011

    Posted 21 Feb 2011 Link to this post

    Hey there,

    i have a simple book application with a MultiScaleImage control on each page. The larger the collection of MSICs, the more memory will be taken up. Is there any built in way to let's say have only 6 pages loaded at a time and dynamically load / unload on page flip?

  2. Kiril Stanoev
    Kiril Stanoev avatar
    1512 posts

    Posted 24 Feb 2011 Link to this post

    Hi Tobias,

    At any given moment there are no more than 10 pages within RadBook that are being rendered. No matter if your collection consists of 100 or 1000 items. In your particular scenario, I am not sure what will be the memory consumption when there are 10 MultiScaleImage controls.

    Currently RadBook does not offer load on demand functionality out of the box (similar to RadTreeView). However, in scenarios like yours, such functionality makes sense so I'll add an item in our public issue tracking system under the name "Book: Load on demand support" which will be available for tracking and voting tomorrow the latest.

    Bellow is one possible way to implement load on demand:

    <UserControl x:Class="SilverlightApplication1.MainPage"
        <Grid x:Name="LayoutRoot" Background="White">
            <telerik:RadBook x:Name="book1" Width="500" Height="500" PageChanged="book1_PageChanged">
                        <Border Background="LightGray">
                            <TextBlock Text="{Binding Title}" HorizontalAlignment="Center"
                                    VerticalAlignment="Center" FontSize="36" />

    using System.Collections.ObjectModel;
    using System.Linq;
    using System.Windows.Controls;
    namespace SilverlightApplication1
        public partial class MainPage : UserControl
            private ObservableCollection<Page> pages;
            public MainPage()
                pages = new ObservableCollection<Page>(Enumerable.Range(0,6).Select(i => new Page() { Title = "Page " + i.ToString() }));
                book1.ItemsSource = pages;
            private void book1_PageChanged(object sender, Telerik.Windows.RadRoutedEventArgs e)
                if(book1.RightPageIndex == pages.Count - 1)
                    pages.Add(new Page() { Title = "Page " + (pages.Count).ToString() });
                    pages.Add(new Page() { Title = "Page " + (pages.Count + 1).ToString() });
                    pages.Add(new Page() { Title = "Page " + (pages.Count + 2).ToString() });
                    pages.Add(new Page() { Title = "Page " + (pages.Count + 3).ToString() });
                    pages.Add(new Page() { Title = "Page " + (pages.Count + 4).ToString() });
                    pages.Add(new Page() { Title = "Page " + (pages.Count + 5).ToString() });

    namespace SilverlightApplication1
        public class Page
            public string Title { get; set; }

    Let me know how I can be of further assistance.

    Best wishes,
    Kiril Stanoev
    the Telerik team
    Registration for Q1 2011 What’s New Webinar Week is now open. Mark your calendar for the week starting March 21st and book your seat for a walk through all the exciting stuff we ship with the new release!
Back to Top