<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: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="135"/>
            <ColumnDefinition Width="185*"/>
            <ColumnDefinition Width="175*"/>
            <ColumnDefinition Width="98*"/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="10*"/>
            <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="155*"/>
            <RowDefinition Height="23"/>
            <RowDefinition Height="10*"/>
        </Grid.RowDefinitions>
        <Label Content="対象フォルダ　 　：" Margin="10,0,2.667,2.667" VerticalAlignment="Bottom" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.RowSpan="2" Height="28"/>
        <Label Content="リファレンスフォルダ：" Margin="10,26.333,2.667,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="1" Height="29" Grid.RowSpan="2"/>
        <Label Content="作業フォルダ　 　：" Margin="10,27.333,2.667,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="2" Height="29" Grid.RowSpan="3"/>
        <Label Content="検版レポート名 　：" Margin="10,27.333,2.667,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="3" Height="29" Grid.RowSpan="3"/>
        <Label Content="TIFFパラメーター 　：" Margin="9,27.333,3.667,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="4" Height="29" Grid.RowSpan="3"/>
        <Label Content="検版パラメーター   ：" Margin="12,27.333,0.667,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="6" Height="29" Grid.RowSpan="3"/>
        <TextBox x:Name="targetBox" Grid.Column="1" Margin="10.333,2.333,9.333,0" FontSize="14" Grid.Row="1" Height="24" VerticalAlignment="Top" AllowDrop="True" Drop="TargetBox_Drop" DragOver="textBox_PreviewDragOver" Grid.ColumnSpan="2"/>
        <TextBox x:Name="referenceBox" Grid.Column="1" Margin="10.333,2.333,9.333,0" FontSize="14" Grid.Row="2" Height="24" VerticalAlignment="Top" AllowDrop="True" Drop="RefBox_Drop" DragOver="textBox_PreviewDragOver" Grid.ColumnSpan="2"/>
        <TextBox x:Name="workBox" Grid.Column="1" Margin="10.333,2.333,9.333,0" FontSize="14" Grid.Row="3" Height="24" VerticalAlignment="Top" AllowDrop="True" Drop="WorkBox_Drop" DragOver="textBox_PreviewDragOver" Grid.ColumnSpan="2"/>
        <TextBox x:Name="reportBox" Grid.Column="1" Margin="10.333,2.333,9.333,0" FontSize="14" Grid.Row="4" Height="24" VerticalAlignment="Top" AllowDrop="True" Drop="ReportBox_Drop" DragOver="textBox_PreviewDragOver" Grid.ColumnSpan="2"/>
        <Button x:Name="targetButton" Content="参照" Grid.Column="3" HorizontalAlignment="Left" Margin="6.667,4.333,0,0" VerticalAlignment="Top" Width="75" Grid.Row="1" Height="20" Click="TagetButton_Click"/>
        <Button x:Name="referenceButton" Content="参照" Grid.Column="3" HorizontalAlignment="Left" Margin="6.667,4.333,0,0" VerticalAlignment="Top" Width="75" Grid.Row="2" Height="20" Click="ReferenceButton_Click"/>
        <Button x:Name="workButton" Content="参照" Grid.Column="3" HorizontalAlignment="Left" Margin="6.667,4.333,0,0" VerticalAlignment="Top" Width="75" Grid.Row="3" Height="20" Click="WorkButton_Click"/>
        <Button x:Name="reportButton" Content="参照" Grid.Column="3" HorizontalAlignment="Left" Margin="6.667,4.333,0,0" VerticalAlignment="Top" Width="75" Grid.Row="4" Height="20" Click="ReportButton_Click"/>
        <Label Content="解像度(9 - 300)：" Margin="0.333,0.333,64,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="5" Height="29" Grid.RowSpan="2" Grid.Column="1"/>
        <Label Content="検査範囲：" Margin="0.333,1.333,91,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="6" Height="29" Grid.RowSpan="2" Grid.Column="1"/>
        <StackPanel Grid.Column="1" Grid.Row="5" Orientation="Horizontal" HorizontalAlignment="Left" Margin="124.333,6.333,0,0.667" Width="47" Background="Black">
            <TextBox x:Name="ResolutionBox" Width="30" HorizontalContentAlignment="Right"
                      Text="{Binding Value, ElementName=NumericScroll1}" VerticalContentAlignment="Center" FontSize="14"/>
            <ScrollBar x:Name="NumericScroll1" Value="72" SmallChange="1" LargeChange="1" Maximum="300" Minimum="1" RenderTransformOrigin="0.5,0.5" Cursor="Arrow" Background="#FF3E3E3E" BorderBrush="#FF060606" Foreground="#FF030303" >
                <ScrollBar.RenderTransform>
                    <TransformGroup>
                        <RotateTransform Angle="180"/>
                    </TransformGroup>
                </ScrollBar.RenderTransform>
            </ScrollBar>
        </StackPanel>
        <StackPanel  Grid.Column="1" HorizontalAlignment="Left" Margin="91.333,4.333,0,5.667" Grid.Row="6"  Width="80" Grid.RowSpan="3" >
            <ComboBox x:Name="PageRange" SelectedValuePath="Id" DisplayMemberPath="Item" Height="21" SelectedValue="1" SelectionChanged="PageRange_SelectionChanged" Width="80">
                <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="12,0.333,78.333,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="5" Height="29" Grid.RowSpan="2" Grid.Column="2"/>
        <Label x:Name="pageLabel" Content="指定ページ：" Margin="12,1.333,76.333,0" VerticalAlignment="Top" RenderTransformOrigin="0.544,1.949" FontSize="14" Grid.Row="6" Height="29" Grid.Column="2" IsEnabled="{Binding PageRange_SelectionChanged}" Grid.RowSpan="2"/>
        <StackPanel  Grid.Column="2" HorizontalAlignment="Left" Margin="91,5.333,0,18.667" Grid.Row="5"  Width="75" Grid.RowSpan="2" >
            <ComboBox x:Name="FileSelect" SelectedValuePath="Id" DisplayMemberPath="Item" Height="21" SelectedValue="1" Margin="4,0,-4.333,0" >
                <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="2" Height="23" Margin="95,3.333,45.333,0" Grid.Row="6" 
                 TextWrapping="Wrap" Text="1,2,4-6" VerticalAlignment="Top" FontSize="14" IsEnabled="{Binding PageRange_SelectionChanged}" Grid.ColumnSpan="2"
                 InputMethod.IsInputMethodSuspended="True" PreviewKeyDown="PageBox_PreviewKeyDown" PreviewTextInput="PageBox_PreviewTextInput" LostFocus="PageBox_LostFocus" CommandManager.PreviewExecuted="PageBox_PreviewExecuted"/>
        <TextBox x:Name="ResultConsole" Margin="44,9.333,44.333,9.667" Grid.Row="9" Grid.ColumnSpan="4" VerticalScrollBarVisibility="Auto" FontSize="14" IsReadOnly="True" HorizontalScrollBarVisibility="Auto"/>
        <Button x:Name="TIFFButton" Content="TIFF出力" HorizontalAlignment="Left" Height="22" Margin="45,1.333,0,0" Grid.Row="10" VerticalAlignment="Top" Width="82" Grid.RowSpan="2" Click="TIFFButtonClick"/>
        <Button x:Name="CompareButton" Content="比較" HorizontalAlignment="Left" Height="22" Margin="13.333,1.333,0,0" Grid.Row="10" VerticalAlignment="Top" Width="82" Grid.Column="1" Grid.RowSpan="2" Click="CompareButtonClick"/>
        <Button x:Name="closeButton" Content="Close" Height="22" Margin="0,1.333,45.333,0" Grid.Row="10" VerticalAlignment="Top" Grid.Column="2" Grid.ColumnSpan="2" Grid.RowSpan="2" HorizontalAlignment="Right" Width="77" Click="CloseButton_Click"/>
        <Label Content="位置ズレ許容量(0 - 2)：" Margin="0.333,0.333,30,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="154.333,3.333,0,3.667" Width="33" Background="Black" Grid.ColumnSpan="2">
            <TextBox x:Name="PositionBox" Width="16" HorizontalContentAlignment="Center"
                      Text="{Binding Value, ElementName=PosiScroll1}" VerticalContentAlignment="Center" FontSize="14"/>
            <ScrollBar x:Name="PosiScroll1" Value="2" SmallChange="1" LargeChange="1" Maximum="2" Minimum="0" RenderTransformOrigin="0.5,0.5" Cursor="Arrow" Background="#FF3E3E3E" BorderBrush="#FF060606" Foreground="#FF030303" >
                <ScrollBar.RenderTransform>
                    <TransformGroup>
                        <RotateTransform Angle="180"/>
                    </TransformGroup>
                </ScrollBar.RenderTransform>
            </ScrollBar>
        </StackPanel>
        <Label Content="諧調差許容量(0 - 255)：" Margin="13,0.333,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" Grid.ColumnSpan="2"/>
        <StackPanel Grid.Column="2" Grid.Row="7" Orientation="Horizontal" HorizontalAlignment="Left" Margin="175,4.333,0,2.667" Width="50" Background="Black" Grid.ColumnSpan="2">
            <TextBox x:Name="GradationBox" Width="33" HorizontalContentAlignment="Right"
                      Text="{Binding Value, ElementName=GradScroll}" VerticalContentAlignment="Center" FontSize="14" Margin="0,0,0,0.333"/>
            <ScrollBar x:Name="GradScroll" Value="60" SmallChange="1" LargeChange="1" Maximum="255" Minimum="0" RenderTransformOrigin="0.5,0.5" Cursor="Arrow" Background="#FF3E3E3E" BorderBrush="#FF060606" Foreground="#FF030303" >
                <ScrollBar.RenderTransform>
                    <TransformGroup>
                        <RotateTransform Angle="180"/>
                    </TransformGroup>
                </ScrollBar.RenderTransform>
            </ScrollBar>
        </StackPanel>
        <Label Content="微小差異許容量(0 - 8)：" Margin="0.333,0.333,17,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="154.333,3.333,0,3.667" Width="33" Background="Black" Grid.ColumnSpan="2">
            <TextBox x:Name="SmallDiffBox" Width="16" HorizontalContentAlignment="Center"
                      Text="{Binding Value, ElementName=SmallDiffScroll}" VerticalContentAlignment="Center" FontSize="14"/>
            <ScrollBar x:Name="SmallDiffScroll" Value="8" SmallChange="1" LargeChange="1" Maximum="8" Minimum="0" RenderTransformOrigin="0.5,0.5" Cursor="Arrow" Background="#FF3E3E3E" BorderBrush="#FF060606" Foreground="#FF030303" >
                <ScrollBar.RenderTransform>
                    <TransformGroup>
                        <RotateTransform Angle="180"/>
                    </TransformGroup>
                </ScrollBar.RenderTransform>
            </ScrollBar>
        </StackPanel>
        <Label Content="視覚的あいまい量(0 - 7)：" Margin="13,0.333,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" Grid.ColumnSpan="2"/>
        <StackPanel Grid.Column="2" Grid.Row="8" Orientation="Horizontal" Margin="175,5.333,0,1.667" Background="Black" HorizontalAlignment="Left" Width="50" Grid.ColumnSpan="2">
            <TextBox x:Name="VisualBox" Width="33" HorizontalContentAlignment="Right"
                      Text="{Binding Value, ElementName=VisualScroll}" VerticalContentAlignment="Center" FontSize="14"/>
            <ScrollBar x:Name="VisualScroll" Value="5" SmallChange="1" LargeChange="1" Maximum="7" Minimum="0" RenderTransformOrigin="0.5,0.5" Cursor="Arrow" Background="#FF3E3E3E" BorderBrush="#FF060606" Foreground="#FF030303" >
                <ScrollBar.RenderTransform>
                    <TransformGroup>
                        <RotateTransform Angle="180"/>
                    </TransformGroup>
                </ScrollBar.RenderTransform>
            </ScrollBar>
        </StackPanel>
    </Grid>
</Window>
