<Window Name="d"
        x:Class="PDFViewWPFTestCS.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="using:PDFViewWPFTestCS"
        Title="PDFViewWPF" Height="700" Width="900" MinHeight="200" MinWidth="350" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}">

    <Window.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="Resources/StyleResource.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </Window.Resources>

    <Grid Name="LayoutRoot" UseLayoutRounding="True">
        <Grid Name="MainWindowGrid" UseLayoutRounding="True">
            <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="Open URL" Click="btnOpenUrl_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>
                    <MenuItem Header="Tool">
                        <MenuItem Name="PanToolMenuItem" Header="Pan" Click="PanTool_Clicked" IsCheckable="True"/>
                        <MenuItem Name="AnnotationEditToolMenuItem" Header="Annotation Edit" Click="AnnotationEditTool_Clicked" IsCheckable="True"/>
                        <MenuItem Name="LineToolMenuItem" Header="Line" Click="LineTool_Clicked" IsCheckable="True"/>
                        <MenuItem Name="PolylineToolMenuItem" Header="Polyline" Click="PolylineTool_Click" IsCheckable="True"/>
                        <MenuItem Name="PolygonToolMenuItem" Header="Polygon" Click="PolygonTool_Click" IsCheckable="True"/>
                        <MenuItem Name="ArrowToolMenuItem" Header="Arrow" Click="ArrowTool_Clicked" IsCheckable="True"/>
                        <MenuItem Name="OvalToolMenuItem" Header="Oval" Click="OvalTool_Clicked" IsCheckable="True"/>
                        <MenuItem Name="RectangleToolMenuItem" Header="Rectangle" Click="RectangleTool_Clicked" IsCheckable="True" />
                        <MenuItem Name="InkToolMenuItem" Header="Ink" Click="InkTool_Clicked" IsCheckable="True"/>
                        <MenuItem Name="HighlightToolMenuItem" Header="Highlight" Click="HighlightTool_Clicked" IsCheckable="True"/>
                        <MenuItem Name="UnderlineToolMenuItem" Header="Underline" Click="UnderlineTool_Clicked" IsCheckable="True"/>
                        <MenuItem Name="StrikeoutToolMenuItem" Header="Strikeout" Click="StrikeoutTool_Clicked" IsCheckable="True"/>
                        <MenuItem Name="SquigglyToolMenuItem" Header="Squiggly" Click="SquigglyTool_Clicked" IsCheckable="True" />
                        <MenuItem Name="TextBoxToolMenuItem" Header="Text Box" Click="FreeTextToolTool_Clicked" IsCheckable="True"/>
                        <MenuItem Name="CalloutToolMenuItem" Header="Callout" Click="CalloutTool_Clicked" IsCheckable="True"/>
                        <MenuItem Name="StickyNoteToolMenuItem" Header="Sticky Note" Click="StickyNoteTool_Clicked" IsCheckable="True"/>
                    </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="1" Name="toolbar_header0" >
                        <Button Click="btnCollapsed_Clicked" Name="btn_collapse" IsEnabled="False">
                            <Image Source="Resources\section_expanded.png" Height="16"/>
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Hide Navigation Sidebar"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </Button>
                        <Button Click="btnExpand_Clicked" Name="btn_expand" IsEnabled="False">
                            <Image Source="Resources\section_collapsed.png" Height="16"/>
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Show Navigation Sidebar"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </Button>
                    </ToolBar>
                    <ToolBar Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Band="1" BandIndex="2" Name="toolbar_header1" >
                        <Button Click="btnOpen_Clicked">
                            <Image Source="Resources\fileopen.gif"/>
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Open"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </Button>
                        <Button Name="btn_save" Click="btnSave_Clicked" IsEnabled="False">
                            <Image Source="Resources\saveas.gif" />
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Save"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </Button>
                        <Button Name="btn_print" Click="btnPrint_Clicked" IsEnabled="False">
                            <Image Source="Resources\print.gif" IsEnabled="False"/>
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Print"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </Button>
                    </ToolBar>
                    <ToolBar Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" Band="1" BandIndex="3" Name="toolbar_header2" IsEnabled="False" >
                        <ToggleButton Click="PanTool_Clicked" Name="t_pan">
                            <Image Source="Resources\handtool.gif" />
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Hand"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </ToggleButton>
                        <ToggleButton Click="TextSelectRect_Clicked" Name="t_text_rect">
                            <Image Source="Resources\text2tool.gif" />
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Select Text (Rectangular)"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </ToggleButton>
                        <ToggleButton Click="TextSelectStruct_Clicked" Name="t_text_struct">
                            <Image Source="Resources\texttool.gif" />
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Select Text (Structual)"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </ToggleButton>
                        <ToggleButton Click="AnnotationEditTool_Clicked" Name="t_annot_edit">
                            <Image Source="Resources\Annotations\annot_edit.png" Height="20"/>
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Annotation Edit"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </ToggleButton>
                        <!--<Separator />
                        <ToggleButton Click="OnPointZoomIn_Clicked" Name="t_zoom_in">
                            <Image Source="Resources\zoomin_tool.gif" />
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Zoom In Tool"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </ToggleButton>
                        <ToggleButton Click="OnPointZoomOut_Clicked" Name="t_zoom_out">
                            <Image Source="Resources\zoomout_tool.gif" />
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Zoom Out Tool"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </ToggleButton>-->
                        <Separator />
                        <Button Click="btn_ZoomIn_Clicked">
                            <Image Source="Resources\zoomin.gif"/>
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Zoom In"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </Button>
                        <Button Click="btn_ZoomOut_Clicked">
                            <Image Source="Resources\zoomout.gif" />
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Zoom Out"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </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"/>
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Fit Page"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </Button>
                        <Button Click="FitWidth_Clicked">
                            <Image Source="Resources\arrow_ew.png" Height="16"/>
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Fit Width"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </Button>
                        <Separator />
                        <ToggleButton Name="SinglePageButton" Click="SinglePage_Clicked">
                            <Image Source="Resources\page_single.png" Height="16"/>
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Single Page"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </ToggleButton>
                        <ToggleButton Name="SingleContinuousButton" Click="SingleContinuous_Clicked">
                            <Image Source="Resources\page_cont.png" Height="16"/>
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Single Continuous"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </ToggleButton>
                        <ToggleButton Name="FacingButton" Click="Facing_Clicked">
                            <Image Source="Resources\page_facing.png" Height="16"/>
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Facing"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </ToggleButton>
                        <ToggleButton Name="FacingContinuousButton" Click="FacingContinuous_Clicked">
                            <Image Source="Resources\page_facing_cont.png" Height="16"/>
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Facing Continuous"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </ToggleButton>
                        <ToggleButton Name="FacingCoverButton" Click="FacingCover_Clicked">
                            <Image Source="Resources\page_cover_facing.png" Height="16"/>
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Facing Cover"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </ToggleButton>
                        <ToggleButton Name="FacingCoverContinuousButton" Click="FacingCoverContinuous_Clicked">
                            <Image Source="Resources\page_cover_facing_cont.png" Height="16"/>
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Facing Cover Continuous"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </ToggleButton>
                        <Separator />
                        <Button Click="btn_RotateCW_Clicked">
                            <Image Source="Resources\arrow_rotate_clockwise.png" Height="16"/>
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Rotate Clockwise"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </Button>
                        <Button Click="btn_RotateCCW_Clicked">
                            <Image Source="Resources\arrow_rotate_anticlockwise.png" Height="16"/>
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Rotate Counterclockwise"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </Button>
                    </ToolBar>
                </ToolBarTray>
            </Grid>
            <Separator Background="Silver" Height="1" Grid.Row="1" VerticalAlignment="Bottom"/>
            <Grid Grid.Row="2" Name="PDFGrid" UseLayoutRounding="True">
                <TabControl Name="PDFTab" Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" BorderBrush="Silver"
                            UseLayoutRounding="True" SelectionChanged="PDFTab_SelectionChanged" 
                            Style="{StaticResource ResourceKey=TabControlStyle}" ItemContainerStyle="{StaticResource ResourceKey=TabItemStyle}" />
            </Grid>
            <Separator Background="Silver" Height="1" Grid.Row="3" VerticalAlignment="Top"/>
            <Grid Grid.Row="3"  Margin="0,1,0,0">
                <ToolBarTray IsLocked="True" HorizontalAlignment="Right" Margin="0, 2, 0, 0">
                <ToolBar Background="{DynamicResource {x:Static SystemColors.ControlBrushKey}}" HorizontalAlignment="Right" Name="toolbar_footer" 
                         IsEnabled="False" Margin="0,1,0,0">
                        <ToolBar.Resources>
                            <Style TargetType="Button">
                                <Setter Property="BorderThickness" Value="0"/>
                                <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
                            </Style>
                        </ToolBar.Resources>
                            <StackPanel Orientation="Horizontal">
                            <Button Click="btn_FirstPage_Clicked">
                                <Image Source="Resources\previous-green.png" Height="16"/>
                                <ToolTipService.ToolTip>
                                    <ToolTip Placement="Bottom">
                                        <TextBlock Text="First Page"/>
                                    </ToolTip>
                                </ToolTipService.ToolTip>
                            </Button>
                            <Button Click="btn_Prev_Clicked">
                                <Image Source="Resources\reverse_green.png" Height="16"/>
                                <ToolTipService.ToolTip>
                                    <ToolTip Placement="Bottom">
                                        <TextBlock Text="Previous Page"/>
                                    </ToolTip>
                                </ToolTipService.ToolTip>
                        </Button>
                        <TextBox Width="40" Name="txtbox_pagenum" HorizontalContentAlignment="Center" BorderBrush="Silver" 
                                 MaxLength="10" VerticalContentAlignment="Center" TextAlignment="Center"/>
                        <Label Width="45" Name="txt_pagecount" HorizontalContentAlignment="Center"/>
                                <Button Click="btn_Next_Clicked">
                            <Image Source="Resources\play_green.png" Height="16"/>
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Next Page"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </Button>
                        <Button Click="btn_LastPage_Clicked">
                            <Image Source="Resources\next_green.png" Height="16"/>
                            <ToolTipService.ToolTip>
                                <ToolTip Placement="Bottom">
                                    <TextBlock Text="Last Page"/>
                                </ToolTip>
                            </ToolTipService.ToolTip>
                        </Button>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal">
                        <Button Click="btn_ZoomOut_Clicked">
                            <Image Source="Resources\zoomout.gif" />
                        </Button>
                        <Slider Width="100" Name="slider_zoom" Maximum="10" Minimum="0.1" TickFrequency="0.1"/>
                        <Button Click="btn_ZoomIn_Clicked">
                            <Image Source="Resources\zoomin.gif" />
                        </Button>
                            <TextBox Width="50" Name="txtbox_zoom" HorizontalContentAlignment="Center" BorderBrush="Silver" VerticalContentAlignment="Center" TextAlignment="Center"/>
                        <Label Width="20" Content="%" HorizontalContentAlignment="Left"/>
                    </StackPanel>
                </ToolBar> 
                </ToolBarTray>
            </Grid>
        </Grid>
    </Grid>
</Window>
