<UserControl
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    
    xmlns:book="clr-namespace:SLMitsuControls;assembly=SLMitsuControls"
    xmlns:toolkit="http://schemas.microsoft.com/winfx/2006/xaml/presentation/toolkit" xmlns:local="clr-namespace:FlipBook" x:Class="FlipBook.MainPage"
    mc:Ignorable="d"
    d:DesignHeight="600" d:DesignWidth="800" Loaded="UserControl_Loaded">

    <UserControl.Resources>
        <LinearGradientBrush x:Key="GrayGradientBrush" StartPoint="0.8,0" EndPoint="0.2,1">
            <GradientStop Color="DarkGray" Offset="0.25" />
            <GradientStop Color="LightGray" Offset="1.0" />
        </LinearGradientBrush>

        <Style x:Key="GrayGradientStyle" TargetType="Path">
            <Setter Property="Stroke" Value="Gray" />
            <Setter Property="Fill" Value="{StaticResource GrayGradientBrush}" />
        </Style>
    </UserControl.Resources>

    <Grid x:Name="LayoutRoot" Background="White">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="1*"/>
            <ColumnDefinition Width="9*"/>
            <ColumnDefinition Width="1*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="*"/>
            <RowDefinition Height="40"/>
        </Grid.RowDefinitions>

        <Border BorderBrush="DarkGray" Background="LightGray" BorderThickness="1" Grid.Column="1">
            <Border.Effect>
                <DropShadowEffect/>
            </Border.Effect>
            <Viewbox x:Name="BookViewBox"  Margin="5,10,10,5" Stretch="Uniform">
                <Grid Background="White" Margin="2" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
                    <book:UCBook x:Name="ucbook"/>                    
                </Grid>                
            </Viewbox>
        </Border>
        <StackPanel Orientation="Horizontal" Grid.Row="1" Grid.Column="1" HorizontalAlignment="Center" Margin="5,5,5,10">
            <RepeatButton x:Name="PreviousPageButton" Click="PreviousPageButton_Click" Margin="0,1,0,1">
                <RepeatButton.Effect>
                    <DropShadowEffect Direction="10" ShadowDepth="2" />
                </RepeatButton.Effect>
                <Path Data="M 15,0 L 15,15 L 0,7.5 Z" Style="{StaticResource GrayGradientStyle}" />
                <ToolTipService.ToolTip>
                    <ToolTip Placement="Bottom">
                        <TextBlock Text="Go to previous page"/>
                    </ToolTip>
                </ToolTipService.ToolTip>
            </RepeatButton>

            <Border Margin="1,3,1,3">
                <Border.Effect>
                    <DropShadowEffect Direction="10" ShadowDepth="2" />
                </Border.Effect>
                <Grid Width="100" Background="White">
                    <StackPanel Orientation="Horizontal" HorizontalAlignment="Center" Width="auto">
                        <TextBlock x:Name="LeftPageNumberText" Text="0" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        <TextBlock x:Name="AmpersandText" Text="&amp;" Visibility="Collapsed" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        <TextBlock x:Name="RightPageNumberText" Text="" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        <TextBlock Text="/" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                        <TextBlock x:Name="TotalPagesText" Text="0" FontSize="14" HorizontalAlignment="Center" VerticalAlignment="Center"/>
                    </StackPanel>
                </Grid>
            </Border>

            <RepeatButton x:Name="NextPageButton"  Margin="0,1,0,1" Click="NextPageButton_Click"  >
                <RepeatButton.Effect>
                    <DropShadowEffect Direction="10" ShadowDepth="2" />
                </RepeatButton.Effect>
                <Path Data="M 0,0 L 0,15 L 15,7.5 Z"  Style="{StaticResource GrayGradientStyle}" />
                <ToolTipService.ToolTip>
                    <ToolTip Placement="Bottom">
                        <TextBlock Text="Go to next page"/>
                    </ToolTip>
                </ToolTipService.ToolTip>
            </RepeatButton>
        </StackPanel>

    </Grid>
</UserControl>
