<Window x:Name="mainWindow" x:Class="CSRender.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
        xmlns:wfc="clr-namespace:System.Windows.Forms;assembly=System.Windows.Forms"
        xmlns:local="clr-namespace:CSRender"
        xmlns:sys="clr-namespace:System;assembly=mscorlib"
        mc:Ignorable="d"
        Title="CSRender" Height="475" Width="600" Background="#FFF3F4F4" MinWidth="600" MinHeight="330">

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="136"/>
            <ColumnDefinition Width="195*"/>
            <ColumnDefinition Width="178*"/>
            <ColumnDefinition Width="85*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="11*"/>
            <RowDefinition Height="28"/>
            <RowDefinition Height="28"/>
            <RowDefinition Height="28"/>
            <RowDefinition Height="28"/>
            <RowDefinition Height="28"/>
            <RowDefinition Height="28"/>
            <RowDefinition Height="28"/>
            <RowDefinition Height="28"/>
            <RowDefinition Height="177*"/>
            <RowDefinition Height="30"/>
            <RowDefinition Height="3*"/>
        </Grid.RowDefinitions>
        <Label Content="対象フォルダ　   　：" Margin="8,0,0,2.333" VerticalAlignment="Bottom" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.RowSpan="2" Height="28"/>
        <Label Content="リファレンスフォルダ   ：" Margin="5,26.667,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="1" Height="29" Grid.RowSpan="2"/>
        <Label Content="作業フォルダ       　：" Margin="7,27.667,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="2" Height="29" Grid.RowSpan="3"/>
        <Label Content="レポート出力フォルダ：" Margin="7,27.667,183.667,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="3" Height="29" Grid.RowSpan="3" Grid.ColumnSpan="2"/>
        <Label Content="画像出力設定値   ：" Margin="7,27.667,1,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="4" Height="29" Grid.RowSpan="3"/>
        <Label Content="検版設定値　      ：" Margin="9,27.667,181.667,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="6" Height="29" Grid.RowSpan="3" Grid.ColumnSpan="2"/>
        <TextBox x:Name="targetBox" Grid.Column="1" Margin="9,2.667,8.667,0" FontSize="14" Grid.Row="1" Height="24" VerticalAlignment="Top" AllowDrop="True" Drop="TargetBox_Drop" DragOver="textBox_PreviewDragOver" Grid.ColumnSpan="2" BorderBrush="#FF595959"/>
        <TextBox x:Name="referenceBox" Grid.Column="1" Margin="9,2.667,8.667,0" FontSize="14" Grid.Row="2" Height="24" VerticalAlignment="Top" AllowDrop="True" Drop="RefBox_Drop" DragOver="textBox_PreviewDragOver" Grid.ColumnSpan="2" BorderBrush="#FF595959"/>
        <TextBox x:Name="workBox" Grid.Column="1" Margin="9,2.667,8.667,0" FontSize="14" Grid.Row="3" Height="24" VerticalAlignment="Top" AllowDrop="True" Drop="WorkBox_Drop" DragOver="textBox_PreviewDragOver" Grid.ColumnSpan="2" BorderBrush="#FF595959"/>
        <TextBox x:Name="reportBox" Grid.Column="1" Margin="9,2.667,8.667,0" FontSize="14" Grid.Row="4" Height="24" VerticalAlignment="Top" AllowDrop="True" Drop="ReportBox_Drop" DragOver="textBox_PreviewDragOver" Grid.ColumnSpan="2" BorderBrush="#FF595959"/>
        <Button x:Name="targetButton" Content="参照" Grid.Column="3" HorizontalAlignment="Left" Margin="5.333,4.667,0,0" VerticalAlignment="Top" Width="65" Grid.Row="1" Height="20" Click="TagetButton_Click"/>
        <Button x:Name="referenceButton" Content="参照" Grid.Column="3" HorizontalAlignment="Left" Margin="5.333,4.667,0,0" VerticalAlignment="Top" Width="65" Grid.Row="2" Height="20" Click="ReferenceButton_Click"/>
        <Button x:Name="workButton" Content="参照" Grid.Column="3" HorizontalAlignment="Left" Margin="5.333,4.667,0,0" VerticalAlignment="Top" Width="65" Grid.Row="3" Height="20" Click="WorkButton_Click"/>
        <Button x:Name="reportButton" Content="参照" Grid.Column="3" HorizontalAlignment="Left" Margin="5.333,4.667,0,0" VerticalAlignment="Top" Width="65" Grid.Row="4" Height="20" Click="ReportButton_Click"/>
        <Label Content="解像度(9 - 300)：" Margin="1,0.667,63.667,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="5" Height="29" Grid.RowSpan="2" Grid.Column="1"/>
        <Label Content="検査範囲：" Margin="11.333,0.667,62.667,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="5" Height="29" Grid.RowSpan="2" Grid.Column="2"/>
        <StackPanel Grid.Column="1" Grid.Row="5" Orientation="Horizontal" HorizontalAlignment="Left" Margin="123,4.667,0,2.333" Width="47" Background="WhiteSmoke">
            <WindowsFormsHost Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="47"  Background="Orange">
                <wfc:NumericUpDown x:Name="ResolutionBox" x:FieldModifier="public" Maximum="300" Minimum="1" Value="72" ReadOnly="False" Width="47" Margin="10,10,0,0" BorderStyle="FixedSingle"/>
            </WindowsFormsHost>

        </StackPanel>
        <StackPanel  Grid.Column="2" HorizontalAlignment="Left" Margin="102.333,4.667,0,5.333" Grid.Row="5"  Width="80" Grid.RowSpan="3" Grid.ColumnSpan="2" >
            <ComboBox x:Name="PageRange" SelectedValuePath="Id" DisplayMemberPath="Item" Height="21" SelectedValue="1" SelectionChanged="PageRange_SelectionChanged" Width="80" BorderBrush="#FF3A3A3A">
                <ComboBox.Background>
                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                        <GradientStop Color="#FFF0F0F0" Offset="0"/>
                        <GradientStop Color="Gainsboro" Offset="1"/>
                    </LinearGradientBrush>
                </ComboBox.Background>
            </ComboBox>
        </StackPanel>
        <Label Content="出力形式：" Margin="9,0,43,2" VerticalAlignment="Bottom" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="9" Height="29" Grid.RowSpan="2"/>
        <Label x:Name="pageLabel" Content="指定ページ：" Margin="1,27.667,91.667,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="5" Height="29" IsEnabled="{Binding PageRange_SelectionChanged}" Grid.RowSpan="3" Grid.Column="1"/>
        <StackPanel HorizontalAlignment="Left" Margin="84,2,0,0" Grid.Row="10"  Width="71" Grid.RowSpan="2" Grid.ColumnSpan="2" >
            <ComboBox x:Name="FileSelect" SelectedValuePath="Id" DisplayMemberPath="Item" Height="21" SelectedValue="1" Margin="0,0,9.667,0" BorderBrush="#FF3A3A3A" >
                <ComboBox.Background>
                    <LinearGradientBrush EndPoint="0,1" StartPoint="0,0">
                        <GradientStop Color="#FFF0F0F0" Offset="0"/>
                        <GradientStop Color="Gainsboro" Offset="1"/>
                    </LinearGradientBrush>
                </ComboBox.Background>
            </ComboBox>
        </StackPanel>
        <TextBox x:Name="pageBox" Grid.Column="1" Height="23" Margin="80,3.667,44.333,0" Grid.Row="6" 
                 TextWrapping="Wrap" Text="1,2,4-6" VerticalAlignment="Top" FontSize="14" IsEnabled="{Binding PageRange_SelectionChanged}" Grid.ColumnSpan="3"
                 InputMethod.IsInputMethodSuspended="True" PreviewKeyDown="PageBox_PreviewKeyDown" PreviewTextInput="PageBox_PreviewTextInput" LostFocus="PageBox_LostFocus" CommandManager.PreviewExecuted="PageBox_PreviewExecuted" BorderBrush="#FF595959"/>
        <TextBox x:Name="ResultConsole" Margin="44,6.667,44.333,8.667" Grid.Row="9" Grid.ColumnSpan="4" VerticalScrollBarVisibility="Auto" FontSize="14" IsReadOnly="True" HorizontalScrollBarVisibility="Auto" BorderBrush="#FF595959" Panel.ZIndex="1"/>
        <Button x:Name="TIFFButton" Content="画像出力" HorizontalAlignment="Left" Height="22" Margin="17,2,0,0" Grid.Row="10" VerticalAlignment="Top" Width="70" Click="TIFFButtonClick" Grid.Column="1"/>
        <Button x:Name="CompareButton" Content="比較" HorizontalAlignment="Left" Height="22" Margin="96,2,0,0" Grid.Row="10" VerticalAlignment="Top" Width="70" Grid.Column="1" Click="CompareButtonClick"/>
        <Button x:Name="closeButton" Content="Close" Height="22" Margin="0,2.333,45.333,0" Grid.Row="10" VerticalAlignment="Top" Grid.Column="2" Grid.ColumnSpan="2" HorizontalAlignment="Right" Width="70" Click="CloseButton_Click"/>
        <Button x:Name="cancelButton" Content="Cancel" Height="22" Margin="0,2,39,0" Grid.Row="10" VerticalAlignment="Top" Grid.Column="2" HorizontalAlignment="Right" Width="70" Click="CancelButton_Click"/>
        <Label Content="位置ズレ許容量(0 - 2)：" Margin="1,0.667,29.667,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="7" Height="29" Grid.RowSpan="2" Grid.Column="1"/>
        <StackPanel Grid.Column="1" Grid.Row="7" Orientation="Horizontal" HorizontalAlignment="Left" Margin="153,4.667,0,2.333" Width="32" Background="WhiteSmoke">

            <WindowsFormsHost Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="32"  Background="Orange">
                <wfc:NumericUpDown x:Name="PositionBox" x:FieldModifier="public" Maximum="2" Minimum="0" Value="2" ReadOnly="False" Width="32" Margin="10,10,0,0" BorderStyle="FixedSingle"/>
            </WindowsFormsHost>

        </StackPanel>
        <Label Content="諧調差許容量(0 - 255)：" Margin="11.333,0.667,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="7" Height="29" Grid.RowSpan="2" Grid.Column="2" HorizontalAlignment="Left" Width="163"/>
        <StackPanel Grid.Column="2" Grid.Row="7" Orientation="Horizontal" HorizontalAlignment="Left" Margin="172.333,4.667,0,2.333" Width="43" Background="WhiteSmoke" Grid.ColumnSpan="2">

            <WindowsFormsHost Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="43"  Background="Orange">
                <wfc:NumericUpDown x:Name="GradationBox" x:FieldModifier="public" Maximum="255" Minimum="0" Value="60" ReadOnly="False" Width="43" Margin="10,10,0,0" BorderStyle="FixedSingle"/>
            </WindowsFormsHost>

        </StackPanel>
        <Label Content="微小差異許容量(0 - 8)：" Margin="1,0.667,16.667,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="8" Height="29" Grid.RowSpan="2" Grid.Column="1"/>
        <StackPanel Grid.Column="1" Grid.Row="8" Orientation="Horizontal" HorizontalAlignment="Left" Margin="153,4.667,0,2.333" Width="32" Background="WhiteSmoke">


            <WindowsFormsHost Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="32"  Background="Orange">
                <wfc:NumericUpDown x:Name="SmallDiffBox" x:FieldModifier="public" Maximum="8" Minimum="0" Value="8" ReadOnly="False" Width="32" Margin="10,10,0,0" BorderStyle="FixedSingle"/>
            </WindowsFormsHost>

        </StackPanel>
        <Label Content="視覚的あいまい量(0 - 7)：" Margin="11.333,0.667,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="8" Height="29" Grid.RowSpan="2" Grid.Column="2" HorizontalAlignment="Left" Width="163"/>
        <StackPanel Grid.Column="2" Grid.Row="8" Orientation="Horizontal" Margin="172.333,5.667,0,1.333" Background="WhiteSmoke" HorizontalAlignment="Left" Width="43" Grid.ColumnSpan="2">


            <WindowsFormsHost Margin="0,0,0,0" HorizontalAlignment="Left" VerticalAlignment="Top" Width="43"  Background="Orange">
                <wfc:NumericUpDown x:Name="VisualBox" x:FieldModifier="public" Maximum="7" Minimum="0" Value="5" ReadOnly="False" Width="43" Margin="10,10,0,0" BorderStyle="FixedSingle"/>
            </WindowsFormsHost>

        </StackPanel>
        <TextBox x:Name="allNumBox" Grid.Column="1" HorizontalAlignment="Left" Height="23" Margin="45,52.667,0,0" Grid.Row="9" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="27"/>
        <TextBox x:Name="NGNumBox" Grid.Column="1" HorizontalAlignment="Left" Height="23" Margin="45,80.667,0,0" Grid.Row="9" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="27"/>
        <TextBox x:Name="OKNumBox" Grid.Column="1" HorizontalAlignment="Left" Height="23" Margin="45,108.667,0,0" Grid.Row="9" TextWrapping="Wrap" Text="" VerticalAlignment="Top" Width="27" RenderTransformOrigin="0.535,1.739" Panel.ZIndex="0"/>
    </Grid>
</Window>
