<Window x:Class="RotatePage.MainWindow"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:PageViewWPF="clr-namespace:O2S.Components.PDFView4NET.WPF;assembly=O2S.Components.PDFView4NET.WPF.NETCore"
    Title="PDFView4NET WPF Edition - Rotate Page Demo" Height="530" Width="750" Loaded="Window_Loaded">

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

        <ToolBar Grid.Row="0">
            <!--Open-->
            <Button ToolTip="Open file" Click="OpenFile_Click">
                <Image Source="/fileopen16.png" Width="16" Height="16"/>
            </Button>

            <!--Save-->
            <Button ToolTip="Save file" Click="SaveFile_Click">
                <Image Source="/filesave16.png" Width="16" Height="16"/>
            </Button>

            <!--Close-->
            <Button ToolTip="Close file" Click="CloseFile_Click">
                <Image Source="/fileexit16.png" Width="16" Height="16"/>
            </Button>

            <!--Separator-->
            <Separator/>
            
            <!--Page-->
            <Label Content="Page:"/>
            <ComboBox Margin="0,-2,0,-2" Width="80" ScrollViewer.HorizontalScrollBarVisibility="Auto" ItemsSource="{Binding PageNumbers}" Text="{Binding ElementName=PdfControl, Path=PageNumber, UpdateSourceTrigger=PropertyChanged}"/>
            
            <!--Separator-->
            <Separator/>
            
            <!--RotateLeft-->
            <Button ToolTip="Rotate page 90 degrees counter clockwise" Click="CounterClockWise90_Click">
                <Image Source="/RotatePage90CounterClockwise16.png" Width="16" Height="16"/>
            </Button>
            
            <!--RotateRight-->
            <Button ToolTip="Rotate page 90 degrees clockwise" Click="ClockWise90_Click">
                <Image Source="/RotatePage90Clockwise16.png" Width="16" Height="16"/>
            </Button>
        </ToolBar>

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