<Window x:Class="PDFViewWPFSimple.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:pdfnet="clr-namespace:pdftron.PDF;assembly=PDFNet"
        Title="PDFTron" Height="700" Width="900" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">
    <Grid Name="LayoutRoot">
        <Grid Name="MainWindowGrid">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*"/>
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <Grid Grid.Row="0">
                <Menu Name="menu1" VerticalAlignment="Top">
                    <MenuItem Header="File">
                        <MenuItem Header="Open" Click="btnOpen_Clicked"/>
                        <MenuItem Header="Save" Click="btnSave_Clicked"/>
                        <MenuItem Header="Save As" Click="btnSaveAs_Clicked" />
                        <MenuItem Header="Close" Click="btnClose_Clicked" />
                        <Separator/>
                        <MenuItem Header="Exit" Click="btnExit_Clicked" />
                    </MenuItem>
                    <MenuItem Header="Edit">
                        <MenuItem Header="Select All" Click="btnSelectAll_Clicked" />
                        <MenuItem Header="Deselect All" Click="btnDeselectAll_Clicked" />
                    </MenuItem>
                    <MenuItem Header="View">
                        <MenuItem Header="Page View Mode">
                            <MenuItem Header="Fit Width" Click="FitWidth_Clicked"/>
                            <MenuItem Header="Fit Page" Click="FitPageClicked"/>
                        </MenuItem>
                        <MenuItem Header="Page Layout">
                            <MenuItem Header="Single Page" Click="SinglePage_Clicked"/>
                            <MenuItem Header="Single Continuous" Click="SingleContinuous_Clicked"/>
                            <MenuItem Header="Facing" Click="Facing_Clicked"/>
                            <MenuItem Header="Facing Continuous" Click="FacingContinuous_Clicked"/>
                            <MenuItem Header="Facing Cover" Click="FacingCover_Clicked"/>
                            <MenuItem Header="Facing Continuous Cover" Click="FacingCoverContinuous_Clicked"/>
                        </MenuItem>
                        <MenuItem Header="Zoom In" Click="btn_ZoomIn_Clicked"/>
                        <MenuItem Header="Zoom Out" Click="btn_ZoomOut_Clicked"/>
                        <MenuItem Header="Rotate Clockwise" Click="btn_RotateCW_Clicked"/>
                        <MenuItem Header="Rotate CounterClockwise" Click="btn_RotateCCW_Clicked"/>
                    </MenuItem>
                    <MenuItem Header="Page Navigation">
                        <MenuItem Header="Go To Next Page" Click="btn_Next_Clicked"/>
                        <MenuItem Header="Go To Previous Page" Click="btn_Prev_Clicked"/>
                        <MenuItem Header="Go To First Page" Click="btn_FirstPage_Clicked" />
                        <MenuItem Header="Go To Last Page" Click="btn_LastPage_Clicked" />
                    </MenuItem>
                </Menu>
            </Grid>

            <Grid Grid.Row="1" Margin="0,0,0,1">
                <ToolBarTray VerticalAlignment="Top" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" IsLocked="True">
                    <ToolBar Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Band="1" BandIndex="2" Name="toolbar_header1" >
                        <Button Click="btnOpen_Clicked">
                            <Image Source="Resources\fileopen.gif"/>
                        </Button>
                        <Button Click="btnSave_Clicked">
                            <Image Source="Resources\saveas.gif" />
                        </Button>
                        <Button>
                            <Image Source="Resources\print.gif" />
                        </Button>
                    </ToolBar>
                    <ToolBar Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Band="1" BandIndex="3" Name="toolbar_header2" IsEnabled="False" >
                        <ToggleButton Click="OnPan_Clicked" Name="t_pan" >
                            <Image Source="Resources\handtool.gif" />
                        </ToggleButton>
                        <ToggleButton Click="OnSelectRect_Clicked" Name="t_text_rect">
                            <Image Source="Resources\text2tool.gif" />
                        </ToggleButton>
                        <ToggleButton Click="OnSelectStruct_Clicked" Name="t_text_struct">
                            <Image Source="Resources\texttool.gif" />
                        </ToggleButton>
                        <Separator />
                        <Button Click="btn_ZoomIn_Clicked">
                            <Image Source="Resources\zoomin.gif" />
                        </Button>
                        <Button Click="btn_ZoomOut_Clicked">
                            <Image Source="Resources\zoomout.gif" />
                        </Button>
                    </ToolBar>
                    <ToolBar Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Band="1" BandIndex="4" Name="toolbar_header3" IsEnabled="False" >
                        <Button Click="FitPageClicked">
                            <Image Source="Resources\arrow_nsew.png" Height="16"/>
                        </Button>
                        <Button Click="FitWidth_Clicked">
                            <Image Source="Resources\arrow_ew.png" Height="16"/>
                        </Button>
                        <Separator />
                        <Button Click="SinglePage_Clicked">
                            <Image Source="Resources\page_single.png" Height="16"/>
                        </Button>
                        <Button Click="SingleContinuous_Clicked">
                            <Image Source="Resources\page_cont.png" Height="16"/>
                        </Button>
                        <Button Click="Facing_Clicked">
                            <Image Source="Resources\page_facing.png" Height="16"/>
                        </Button>
                        <Button Click="FacingContinuous_Clicked">
                            <Image Source="Resources\page_facing_cont.png" Height="16"/>
                        </Button>
                        <Button Click="FacingCover_Clicked">
                            <Image Source="Resources\page_cover_facing.png" Height="16"/>
                        </Button>
                        <Button Click="FacingCoverContinuous_Clicked">
                            <Image Source="Resources\page_cover_facing_cont.png" Height="16"/>
                        </Button>
                        <Separator />
                        <Button Click="btn_RotateCW_Clicked">
                            <Image Source="Resources\arrow_rotate_clockwise.png" Height="16"/>
                        </Button>
                        <Button Click="btn_RotateCCW_Clicked">
                            <Image Source="Resources\arrow_rotate_anticlockwise.png" Height="16"/>
                        </Button>
                    </ToolBar>
                </ToolBarTray>
            </Grid>
            <Separator Background="Silver" Height="1" Grid.Row="1" VerticalAlignment="Bottom"/>

            <Grid Grid.Row="2" Name="PDFGrid" Margin="0,1,0,0">
                <pdfnet:PDFViewWPF x:Name="MyPDFView"/>
            </Grid>

            <Separator Background="Silver" Height="1" Grid.Row="3" VerticalAlignment="Top"/>
            <Grid Grid.Row="3"  Margin="0,1,0,0">
                <ToolBar Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" HorizontalAlignment="Right" Name="toolbar_footer" IsEnabled="False" Margin="0,1,0,0">
                    <Button Click="btn_FirstPage_Clicked">
                        <Image Source="Resources\previous-green.png" Height="16"/>
                    </Button>
                    <Button Click="btn_Prev_Clicked">
                        <Image Source="Resources\reverse_green.png" Height="16"/>
                    </Button>
                    <TextBox Width="40" Name="txtbox_pagenum" HorizontalContentAlignment="Center" BorderBrush="Silver"/>
                    <Label Width="45" Name="txt_pagecount" HorizontalContentAlignment="Center" />
                    <Button Click="btn_Next_Clicked">
                        <Image Source="Resources\play_green.png" Height="16"/>
                    </Button>
                    <Button Click="btn_LastPage_Clicked">
                        <Image Source="Resources\next_green.png" Height="16"/>
                    </Button>
                    <Button Click="btn_ZoomOut_Clicked">
                        <Image Source="Resources\zoomout.gif" />
                    </Button>
                    <Slider Width="100" Name="slider_zoom" Maximum="4" Minimum="0.1"/>
                    <Button Click="btn_ZoomIn_Clicked">
                        <Image Source="Resources\zoomin.gif" />
                    </Button>
                    <TextBox Width="40" Name="txtbox_zoom" HorizontalContentAlignment="Center" BorderBrush="Silver" IsReadOnly="True"/>
                    <Label Width="20" Content="%" HorizontalContentAlignment="Left"/>
                </ToolBar>
            </Grid>
            
        </Grid>
    </Grid>
</Window>
