<Window x:Class="FooEditor.LineJumpDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="行ジャンプ" Height="135" Width="300">
    <Window.Resources>
        <Style x:Key="NumberCheck" TargetType="{x:Type TextBox}">
            <Style.Triggers>
                <Trigger Property="Validation.HasError" Value="True">
                    <Setter Property="ToolTip"   
                        Value="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=(Validation.Errors)[0].ErrorContent}" />
                </Trigger>
            </Style.Triggers>
        </Style>
    </Window.Resources>
    <StackPanel Margin="5">
        <Grid>
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="1*"/>
                <ColumnDefinition Width="1*"/>
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition/>
                <RowDefinition/>
            </Grid.RowDefinitions>
            <Label Grid.Row="0" Grid.Column="0">行番号</Label>
            <TextBox Grid.Row="0" Grid.Column="1" Name="JumpToTextBox" Style="{StaticResource NumberCheck}">
                <TextBox.Text>
                    <Binding Path="ToRow" Mode="TwoWay">
                        <Binding.ValidationRules>
                            <ExceptionValidationRule/>
                        </Binding.ValidationRules>
                    </Binding>
                </TextBox.Text>
            </TextBox>
            <Label Grid.Row="1" Grid.Column="0">最終行</Label>
            <Label Grid.Row="1" Grid.Column="1" Content="{Binding MaxRow}"/>
        </Grid>
        <StackPanel Orientation="Horizontal" Margin="0,5,0,5" HorizontalAlignment="Right">
            <Button Name="OK" Height="24" Content="OK" Width="80" Click="OK_Click"/>
            <Button Name="Cancle" Height="24" Content="キャンセル" Width="80" Margin="10,0,0,0" Click="Cancle_Click"/>
        </StackPanel>
    </StackPanel>
</Window>
