<UserControl x:Class="PDFViewWPFTestCS.WholeDocumentSearchControl"
             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="using:PDFViewWPFTestCS"
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="400">

    <UserControl.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="../Resources/StyleResource.xaml"/>
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </UserControl.Resources>
    
    <Grid Name="LayoutRoot" Background="White">
        <Grid Name="WholeDocumentSearchGrid">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="*" />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>
            
            <!--Search Textbox-->
            <Grid Grid.Column="0" Grid.Row="0">
                <TextBox Margin="5,5,0,5" Name="SearchTextBox" KeyDown="SearchTextBox_KeyDown"></TextBox>
            </Grid>
            <Grid Grid.Column="1" Grid.Row="0">
                <Button Margin="5,5,2,5" Name="SearchButton" Width="Auto" Click="SearchButton_Click">
                    <Image Source="../Resources/bullet_magnify.png" Height="16"/>
                    <ToolTipService.ToolTip>
                        <ToolTip Placement="Bottom">
                            <TextBlock Text="Search"/>
                        </ToolTip>
                    </ToolTipService.ToolTip>
                </Button>
            </Grid>
            
            <!--Search Options-->
            <Grid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="2">
                <StackPanel Orientation="Vertical">
                    <CheckBox Name="WholeWordCheckBox" Content="Whole Word Only" Margin="4"/>
                    <CheckBox Name="CaseSensitiveCheckBox" Content="Case Sensitive" Margin="4" />
                </StackPanel>
            </Grid>
            
            <!--Searching Status-->
            <Grid Grid.Row="2" Grid.Column="0">
                <ProgressBar Grid.Column="0" Name="_progressBar" Height="20" Margin="5,0,0,0"/>
            </Grid>
            <Grid Grid.Row="2" Grid.Column="1">
                <Button Margin="5,5,2,5" Name="CancelSearch" Width="Auto" Click="CancelSearch_Click" IsEnabled="False">
                    <Image Source="../Resources/cross.png" Height="16"/>
                    <ToolTipService.ToolTip>
                        <ToolTip Placement="Bottom">
                            <TextBlock Text="Stop"/>
                        </ToolTip>
                    </ToolTipService.ToolTip>
                </Button>
            </Grid>
            <Grid Grid.Row="3" Grid.Column="0" Grid.ColumnSpan="2">
                <TextBlock Name="_summary" Margin="4" TextWrapping="Wrap" FontWeight="Bold"/>
            </Grid>
            <Grid Grid.Row="4" Grid.Column="0" Grid.ColumnSpan="2">
                <ListBox Name="ListSearchResults" SelectionChanged="ListSearchResults_SelectionChanged" SelectionMode="Single">
                    <ListBox.ItemContainerStyle>
                        <Style TargetType="{x:Type ListBoxItem}">
                            <Setter Property="HorizontalContentAlignment" Value="Left"/>
                            <Setter Property="VerticalContentAlignment" Value="Center"/>
                        </Style>
                    </ListBox.ItemContainerStyle>
                </ListBox>
            </Grid>
        </Grid>
        </Grid>
</UserControl>
