Changing "zoom" on the fly inside Rich Text Editor integration with RadBook

3 posts, 1 answers
  1. Darren
    Darren avatar
    6 posts
    Member since:
    Dec 2010

    Posted 22 Feb 2011 Link to this post

    I've got a RadBook control which uses the following DataTemplate for both the right and left page:

    <DataTemplate x:Key="PageTemplate">
        <Grid Background="White">
            <telerik2:RadRichTextPageView HorizontalAlignment="Center"
                ViewManager="{Binding ElementName=viewManager}"
                PageIndex="{Binding Path=PageIndex}"
                    <ScaleTransform ScaleX="0.55" ScaleY="0.55"></ScaleTransform>
            <TextBlock Height="30" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="9"
                Foreground="#5B5B5B" Margin="0,0,0,5" Text="{Binding Path=PageIndexDisplay}" />

    This works pretty well to display a document. However, I need to add a zoom button which I'm guessing means changing the ScaleX and ScaleY properties of the ScaleTransform of the RadRichTextPageView. Is there anyway that I can adjust this programatically? I'm having a tough time trying to descend the Visual Tree to find the RadRichTextPageView.
  2. Answer
    Petar Mladenov
    Petar Mladenov avatar
    2986 posts

    Posted 25 Feb 2011 Link to this post

    Hi Darren,

    You can bind the ScaleX and ScaleY to the Value Property of an invisible RadSlider. Then you can change the slider value on Mouse wheel event or on a button click event. The described approach is realized in the attached solution. It also shows hot to merge html files into one and pass it to a book integrated with richTextBox. First you have to click the merge button and choose a new file name to be used for the merged file. Then after a while (since the htmls are big) the merged document load and you can use the Zoom in/out buttons. The application works slow (due to the big files), but it should be good starting point.
    Please feel free to ask if you need further assistance.

    Best wishes,
    Petar Mladenov
    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!
  3. Darren
    Darren avatar
    6 posts
    Member since:
    Dec 2010

    Posted 25 Feb 2011 Link to this post

    Thanks. That's exactly what I was looking for.
Back to Top