<?xml version="1.0" encoding="utf-8"?>
<UserControl x:Class="PdfExport.Page" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:system="clr-namespace:System;assembly=mscorlib" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml">
    <UserControl.Resources>
        <Storyboard x:Name="LoadingAnimation">
            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="LoadingBackground" Storyboard.TargetProperty="(UIElement.Visibility)">
                <DiscreteObjectKeyFrame KeyTime="0" Value="Visible" />
            </ObjectAnimationUsingKeyFrames>
            <ObjectAnimationUsingKeyFrames Storyboard.TargetName="_btn" Storyboard.TargetProperty="(UIElement.Visibility)">
                <DiscreteObjectKeyFrame KeyTime="0" Value="Collapsed" />
            </ObjectAnimationUsingKeyFrames>
            <Storyboard RepeatBehavior="Forever">
                <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="path" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
                    <SplineDoubleKeyFrame KeyTime="00:00:00" Value="0" />
                    <SplineDoubleKeyFrame KeyTime="00:00:00.65" Value="360" />
                </DoubleAnimationUsingKeyFrames>
            </Storyboard>
        </Storyboard>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition />
        </Grid.RowDefinitions>

        <TextBlock Text="Exporting PDF from a C1RichTextBox" FontSize="18" FontWeight="Bold" />
        <StackPanel Orientation="Horizontal" Grid.Row="1">
            <TextBlock Text="Select a document: " Margin="5,0,0,0" VerticalAlignment="Center" />
            <ComboBox x:Name="_cmb" SelectionChanged="_cmb_SelectionChanged" Padding="15,3,15,3" Margin="5" Width="150" VerticalAlignment="Center" />
            <Grid x:Name="LoadingBackground" IsHitTestVisible="False" Visibility="Collapsed">
                <Grid Height="20" Width="20">
                    <Ellipse StrokeThickness="1" Margin="-10,-10,-10,-10">
                        <Ellipse.Fill>
                            <RadialGradientBrush>
                                <GradientStop Color="#FFFFFFFF" Offset="0.6" />
                                <GradientStop Color="#00FFFFFF" Offset="1" />
                            </RadialGradientBrush>
                        </Ellipse.Fill>
                    </Ellipse>
                    <Path Stretch="Fill" StrokeThickness="1" Data="M15,6.5 C10.305579,6.5 6.5,10.305579 6.5,15 C6.5,19.69442 10.305579,23.5 15,23.5 C19.69442,23.5 23.5,19.69442 23.5,15 C23.5,10.305579 19.69442,6.5 15,6.5 z M15,0.5 C23.008129,0.5 29.5,6.9918714 29.5,15 C29.5,23.008129 23.008129,29.5 15,29.5 C6.9918714,29.5 0.5,23.008129 0.5,15 C0.5,6.9918714 6.9918714,0.5 15,0.5 z">
                        <Path.Fill>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FF6679AA" />
                                <GradientStop Color="#FF30A7CE" Offset="0.996" />
                            </LinearGradientBrush>
                        </Path.Fill>
                    </Path>
                    <Path Stretch="Fill" StrokeThickness="1" Data="M15,6.5 C10.305579,6.5 6.5,10.305579 6.5,15 C6.5,19.69442 10.305579,23.5 15,23.5 C19.69442,23.5 23.5,19.69442 23.5,15 C23.5,10.305579 19.69442,6.5 15,6.5 z M15,0.5 C23.008129,0.5 29.5,6.9918714 29.5,15 C29.5,23.008129 23.008129,29.5 15,29.5 C6.9918714,29.5 0.5,23.008129 0.5,15 C0.5,6.9918714 6.9918714,0.5 15,0.5 z">
                        <Path.Fill>
                            <RadialGradientBrush>
                                <RadialGradientBrush.RelativeTransform>
                                    <TransformGroup>
                                        <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.205" ScaleY="1.205" />
                                        <SkewTransform CenterX="0.5" CenterY="0.5" />
                                        <RotateTransform CenterX="0.5" CenterY="0.5" />
                                        <TranslateTransform X="0.004" Y="0.1" />
                                    </TransformGroup>
                                </RadialGradientBrush.RelativeTransform>
                                <GradientStop Color="#FFFFFFFF" Offset="1" />
                                <GradientStop Color="#00FFFFFF" Offset="0.6" />
                            </RadialGradientBrush>
                        </Path.Fill>
                    </Path>
                    <Path Stretch="Fill" StrokeThickness="1" Data="M15,6.5 C10.305579,6.5 6.5,10.305579 6.5,15 C6.5,19.69442 10.305579,23.5 15,23.5 C19.69442,23.5 23.5,19.69442 23.5,15 C23.5,10.305579 19.69442,6.5 15,6.5 z M15,0.5 C23.008129,0.5 29.5,6.9918714 29.5,15 C29.5,23.008129 23.008129,29.5 15,29.5 C6.9918714,29.5 0.5,23.008129 0.5,15 C0.5,6.9918714 6.9918714,0.5 15,0.5 z">
                        <Path.Fill>
                            <RadialGradientBrush>
                                <RadialGradientBrush.RelativeTransform>
                                    <TransformGroup>
                                        <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="1.205" ScaleY="1.205" />
                                        <SkewTransform CenterX="0.5" CenterY="0.5" />
                                        <RotateTransform CenterX="0.5" CenterY="0.5" />
                                        <TranslateTransform X="0.009" Y="-0.119" />
                                    </TransformGroup>
                                </RadialGradientBrush.RelativeTransform>
                                <GradientStop Color="#FFFFFFFF" Offset="1" />
                                <GradientStop Color="#00FFFFFF" Offset="0.65" />
                            </RadialGradientBrush>
                        </Path.Fill>

                    </Path>
                    <Path Stretch="Fill" StrokeThickness="1" Data="M15,6.5 C10.305579,6.5 6.5,10.305579 6.5,15 C6.5,19.69442 10.305579,23.5 15,23.5 C19.69442,23.5 23.5,19.69442 23.5,15 C23.5,10.305579 19.69442,6.5 15,6.5 z M15,0.5 C23.008129,0.5 29.5,6.9918714 29.5,15 C29.5,23.008129 23.008129,29.5 15,29.5 C6.9918714,29.5 0.5,23.008129 0.5,15 C0.5,6.9918714 6.9918714,0.5 15,0.5 z">
                        <Path.Fill>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#006679AA" Offset="0" />
                                <GradientStop Color="#FF113450" Offset="0.45" />
                                <GradientStop Color="#FF113450" Offset="0.55" />
                                <GradientStop Color="#0030A7CE" Offset="1" />
                            </LinearGradientBrush>
                        </Path.Fill>
                    </Path>
                    <Path Stretch="Fill" StrokeThickness="1" Data="M15,6.5 C10.305579,6.5 6.5,10.305579 6.5,15 C6.5,19.69442 10.305579,23.5 15,23.5 C19.69442,23.5 23.5,19.69442 23.5,15 C23.5,10.305579 19.69442,6.5 15,6.5 z M15,0.5 C23.008129,0.5 29.5,6.9918714 29.5,15 C29.5,23.008129 23.008129,29.5 15,29.5 C6.9918714,29.5 0.5,23.008129 0.5,15 C0.5,6.9918714 6.9918714,0.5 15,0.5 z" Margin="-0.5,-0.5,-0.5,-0.5">
                        <Path.Stroke>
                            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                                <GradientStop Color="#FF657AAA" Offset="0.3" />
                                <GradientStop Color="#FF113450" Offset="0.5" />
                                <GradientStop Color="#FF31A5CC" Offset="0.7" />
                            </LinearGradientBrush>
                        </Path.Stroke>
                    </Path>
                    <Path Stretch="Fill" StrokeThickness="1" Data="M15,6.5 C10.305579,6.5 6.5,10.305579 6.5,15 C6.5,19.69442 10.305579,23.5 15,23.5 C19.69442,23.5 23.5,19.69442 23.5,15 C23.5,10.305579 19.69442,6.5 15,6.5 z M15,0.5 C23.008129,0.5 29.5,6.9918714 29.5,15 C29.5,23.008129 23.008129,29.5 15,29.5 C6.9918714,29.5 0.5,23.008129 0.5,15 C0.5,6.9918714 6.9918714,0.5 15,0.5 z" x:Name="path" RenderTransformOrigin="0.5,0.5">
                        <Path.Fill>
                            <RadialGradientBrush>
                                <RadialGradientBrush.RelativeTransform>
                                    <TransformGroup>
                                        <ScaleTransform CenterX="0.5" CenterY="0.5" ScaleX="0.478" ScaleY="0.495" />
                                        <SkewTransform CenterX="0.5" CenterY="0.5" />
                                        <RotateTransform CenterX="0.5" CenterY="0.5" />
                                        <TranslateTransform X="-0.371" Y="-0.006" />
                                    </TransformGroup>
                                </RadialGradientBrush.RelativeTransform>
                                <GradientStop Color="#00FFFFFF" Offset="1" />
                                <GradientStop Color="#FFFFFFFF" Offset="0.25" />
                            </RadialGradientBrush>
                        </Path.Fill>
                        <Path.RenderTransform>
                            <TransformGroup>
                                <ScaleTransform />
                                <SkewTransform />
                                <RotateTransform />
                                <TranslateTransform />
                            </TransformGroup>
                        </Path.RenderTransform>
                    </Path>
                </Grid>
            </Grid>
            <Button x:Name="_btn" Content="Export to PDF" Click="Button_Click" Padding="15,3,15,3" Margin="15,0,5,0" VerticalAlignment="Center" />
        </StackPanel>
        <c1:C1RichTextBox x:Name="_rtb" Grid.Row="2" Text="Hello friends." />
    </Grid>
</UserControl>