<UserControl x:Class="WPF_Forschung_PDF_ComponentOne.UserControl1"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:WPF_Forschung_PDF_ComponentOne" xmlns:c1="http://schemas.componentone.com/winfx/2006/xaml"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition Width="*"/>
            <ColumnDefinition Width="100"/>
            <ColumnDefinition Width="140"/>
        </Grid.ColumnDefinitions>

        <TextBlock Text="PDF-Pfad" Grid.Row="0" Grid.Column="0"/>
        <TextBox Name="PdfPath" Grid.Row="0" Grid.Column="1" Text="N:\Entwicklung_Projekte\Projekt_Framework_44\Bedienerhilfe\Testdokumente\Test_AS_Links.pdf" KeyDown="PdfPath_KeyDown"/>
        <Button Name="OpenPDFInternal" Grid.Row="0" Grid.Column="3" Content="PDF öffnen" Click="OpenPDFInternal_Click"/>

        <TextBlock Text="Überschrift (QSC-Key)" Grid.Row="1" Grid.Column="0" />
        <TextBox Name="TextmarkText" Grid.Row="1" Grid.Column="1" Text="#QSC120" KeyDown="TextmarkText_KeyDown" ToolTip="#{QSCxx} wird automatisch umgewandelt in die entsprechenden White-Space Sonderzeichen"/>
        <Button Name="JumpToTextmarkText" Grid.Row="1" Grid.Column="3" Content="Überschrift anspringen" Click="JumpToTextmarkText_Click"/>
        <CheckBox Name="ContainsCheckbox" Grid.Row="1" Grid.Column="2" Content="Contains-Suche" VerticalAlignment="Center" IsChecked="True"/>

        <TextBlock Text="Überschrift (Index)" Grid.Row="2" Grid.Column="0"/>
        <TextBox Name="TextmarkIndex" Grid.Row="2" Grid.Column="1" Text="2" KeyDown="TextmarkIndex_KeyDown"/>
        <Button Name="JumpToTextmarkIndex" Grid.Row="2" Grid.Column="3" Content="Überschrift anspringen" Click="JumpToTextmarkIndex_Click"/>

        <TextBlock Text="Volltextsuche" Grid.Row="3" Grid.Column="0"/>
        <TextBox Name="SearchTextBox" Grid.Row="3" Grid.Column="1" Text="Allgemein" KeyDown="SearchTextBox_KeyDown"/>

        <Button Name="SearchPrev" Grid.Row="3" Grid.Column="2" Content="Suche/Zurück" Click="SearchText_Click"/>
        <Button Name="SearchNext" Grid.Row="3" Grid.Column="3" Content="Suche/Weiter" Click="SearchText_Click"/>

        <WrapPanel Grid.Row="4" Grid.ColumnSpan="4" Orientation="Horizontal">
            <Button x:Name="tbZoomIn" Content="Zoom in" Command="{Binding IncreaseZoomCommand, ElementName=pdfViewer}" Click="ToolbarButton_Click"/>
            <Button x:Name="tbZoomOut" Content="Zoom Out" Command="{Binding DecreaseZoomCommand, ElementName=pdfViewer}" Click="ToolbarButton_Click"/>

            <TextBox x:Name="tbPage" Text="{Binding PageNumber, ElementName=pdfViewer, Mode=OneWay}" Width="45" Margin="2" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
                     KeyDown="tbPage_KeyDown"/>
            <TextBlock Text="/" Margin="2" VerticalAlignment="Center" />
            <TextBlock x:Name="lblPageCount" Text="{Binding PageCount, ElementName=pdfViewer, Mode=OneWay}" Margin="2" VerticalAlignment="Center" />

            <Button x:Name="tbFirstPage" Content="First Page" Command="{Binding FirstPageCommand, ElementName=pdfViewer}" Click="ToolbarButton_Click" Margin="10,0,0,0"/>
            <Button x:Name="tbLastPage" Content="Last Page" Command="{Binding LastPageCommand, ElementName=pdfViewer}" Click="ToolbarButton_Click"/>
            <Button x:Name="tbPrevPage" Content="Previous Page" Command="{Binding NextPageCommand, ElementName=pdfViewer}" Click="ToolbarButton_Click"/>
            <Button x:Name="tbNextPage" Content="Next Page" Command="{Binding PreviousPageCommand, ElementName=pdfViewer}" Click="ToolbarButton_Click"/>
            <Button x:Name="tbSave" Content="Save" Command="{Binding SaveCommand, ElementName=pdfViewer}" Click="ToolbarButton_Click"/>
            <Button x:Name="tbPrint" Content="Print" Command="{Binding PrintCommand, ElementName=pdfViewer}" Click="ToolbarButton_Click"/>
            <Button x:Name="tbRotateC" Content="Rotate clockwise" Click="ToolbarButton_Click"/>
            <Button x:Name="tbRotateCC" Content="Rotate counter-clockwise" Click="ToolbarButton_Click"/>

            <Button x:Name="tbPageWidth" Content="Page width" Margin="10,0,0,0" Click="ToolbarButton_Click"/>
            <Button x:Name="tbWholePage" Content="Whole Page" Click="ToolbarButton_Click"/>

            <Button x:Name="tbHideShow" Content="Hide/Show" Click="ToolbarButton_Click" Margin="10,0,0,0" />
        </WrapPanel>

        <c1:C1PdfViewer x:Name="pdfViewer" Loaded="pdfViewer_Loaded" Grid.Row="5" Grid.Column="0" Grid.ColumnSpan="4"
                        AttachmentClick="pdfViewer_AttachmentClick"
                        RequestNavigate="pdfViewer_RequestNavigate"
                        ToolbarVisibility="Collapsed"
                        SelectionBackground="#66e6cd1c"
                        PropertyChanged="pdfViewer_PropertyChanged"/>
    </Grid>
</UserControl>
