<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="Printing.MainPage" mc:Ignorable="d" d:DesignWidth="640" d:DesignHeight="480" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006">
    <Grid>
        <Grid.Resources>
            <DataTemplate x:Name="printTemplate">
                <Grid Height="{Binding ViewManager.PresenterInfo.Height}" Width="{Binding ViewManager.PresenterInfo.Width}">
                    <c1:C1RichTextPresenter Source="{Binding}" Margin="{Binding ViewManager.PresenterInfo.Padding}" />
                </Grid>
            </DataTemplate>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <c1:C1RichTextBoxToolbar x:Name="toolbar">
            <c1:C1RichTextBoxToolbar.Template>
                <ControlTemplate TargetType="c1:C1RichTextBoxToolbar">
                    <c1:C1Toolbar>
                        <c1:C1ToolbarStrip>
                            <c1:C1FontFamilyTool />
                            <c1:C1FontSizeTool />

                            <c1:C1Separator />

                            <c1:C1BoldTool />
                            <c1:C1ItalicTool />
                            <c1:C1UnderlineTool />

                            <c1:C1Separator />

                            <c1:C1ToolbarButton Content="Save as PDF..." Click="PdfSave" HorizontalAlignment="Center" />

                            <c1:C1Separator />

                            <c1:C1ToolbarButton Content="Print" Click="Print" HorizontalAlignment="Center" />

                        </c1:C1ToolbarStrip>
                    </c1:C1Toolbar>
                </ControlTemplate>
            </c1:C1RichTextBoxToolbar.Template>
        </c1:C1RichTextBoxToolbar>
        <c1:C1RichTextBox Grid.Row="1" x:Name="rtb" FontFamily="Times New Roman" FontSize="20" ViewMode="Print" HorizontalContentAlignment="Center" />
    </Grid>
</UserControl>