<UserControl x:Class="RotatePage.MainPage"
    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"
    mc:Ignorable="d"
    xmlns:PageViewSL="clr-namespace:O2S.Components.PDFView4NET.SL;assembly=O2S.Components.PDFView4NET.SL">

    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>

        <Border Grid.Row="0" Background="#FAFAFA">
            <StackPanel Orientation="Horizontal">
                <!--Open-->
                <Button Margin="2" Background="White" ToolTipService.ToolTip="Open file" Click="OpenFile_Click">
                    <Image Source="/Resources/fileopen16.png" Width="16" Height="16"/>
                </Button>

                <!--Save-->
                <Button Margin="2" Background="White" ToolTipService.ToolTip="Save file" Click="SaveFile_Click">
                    <Image Source="/Resources/filesave16.png" Width="16" Height="16"/>
                </Button>

                <!--Close-->
                <Button Margin="2" Background="White" ToolTipService.ToolTip="Close file" Click="CloseFile_Click">
                    <Image Source="/Resources/fileexit16.png" Width="16" Height="16"/>
                </Button>

                <!--Separator-->
                <Line Height="20" Width="1" Margin="2" X1="0" X2="0" Y1="0" Y2="20" Stroke="Black"/>

                <!--Page-->
                <TextBlock Margin="2" Text="Page:" VerticalAlignment="Center"/>
                <ComboBox Name="PageNumberCombo" Margin="2" Width="80" ItemsSource="{Binding PageNumbers}" SelectedItem="{Binding ElementName=PdfControl, Path=PageNumber, Mode=TwoWay}"/>

                <!--Separator-->
                <Line Height="20" Width="1" Margin="2" X1="0" X2="0" Y1="0" Y2="20" Stroke="Black"/>

                <!--RotateLeft-->
                <Button Margin="2" Background="White" ToolTipService.ToolTip="Rotate page 90 degrees counter clockwise" Click="CounterClockWise90_Click">
                    <Image Source="/Resources/RotatePage90CounterClockwise16.png" Width="16" Height="16"/>
                </Button>

                <!--RotateRight-->
                <Button Margin="2" Background="White" ToolTipService.ToolTip="Rotate page 90 degrees clockwise" Click="ClockWise90_Click">
                    <Image Source="/Resources/RotatePage90Clockwise16.png" Width="16" Height="16"/>
                </Button>
            </StackPanel>
        </Border>

        <PageViewSL:PDFPageView Grid.Row="1" Name="PdfControl" Grid.Column="0" Margin="0" BorderThickness="1" BorderBrush="Black"/>
    </Grid>
</UserControl>