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

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

2 Answers 98 Views
Book
This is a migrated thread and some comments may be shown as answers.
Darren
Top achievements
Rank 1
Darren asked on 22 Feb 2011, 07:43 PM
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"
            VerticalAlignment="Center"
            ViewManager="{Binding ElementName=viewManager}"
            PageIndex="{Binding Path=PageIndex}"
            >
            <telerik2:RadRichTextPageView.RenderTransform>
                <ScaleTransform ScaleX="0.55" ScaleY="0.55"></ScaleTransform>
            </telerik2:RadRichTextPageView.RenderTransform>
        </telerik2:RadRichTextPageView>
        <TextBlock Height="30" HorizontalAlignment="Center" VerticalAlignment="Bottom" FontSize="9"
            Foreground="#5B5B5B" Margin="0,0,0,5" Text="{Binding Path=PageIndexDisplay}" />
    </Grid>
</DataTemplate>

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 Answers, 1 is accepted

Sort by
0
Accepted
Petar Mladenov
Telerik team
answered on 25 Feb 2011, 07:56 PM
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!
0
Darren
Top achievements
Rank 1
answered on 25 Feb 2011, 08:47 PM
Thanks. That's exactly what I was looking for.
Tags
Book
Asked by
Darren
Top achievements
Rank 1
Answers by
Petar Mladenov
Telerik team
Darren
Top achievements
Rank 1
Share this question
or