<Window x:Class="XLAB2.PrsnEditWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="{Binding Title}"
        Height="470"
        Width="720"
        MinHeight="440"
        MinWidth="660"
        WindowStartupLocation="CenterOwner">
    <Grid Margin="16">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <Grid Grid.Row="0">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="180" />
                <ColumnDefinition Width="*" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <TextBlock Grid.Row="0" Grid.Column="0" Margin="0,0,12,8" VerticalAlignment="Center" Text="ФИО" />
            <TextBox Grid.Row="0" Grid.Column="1" Margin="0,0,0,8" Text="{Binding FullName, UpdateSourceTrigger=PropertyChanged}" />

            <TextBlock Grid.Row="1" Grid.Column="0" Margin="0,0,12,8" VerticalAlignment="Center" Text="Фамилия" />
            <TextBox Grid.Row="1" Grid.Column="1" Margin="0,0,0,8" Text="{Binding LastName, UpdateSourceTrigger=PropertyChanged}" />

            <TextBlock Grid.Row="2" Grid.Column="0" Margin="0,0,12,8" VerticalAlignment="Center" Text="Имя" />
            <TextBox Grid.Row="2" Grid.Column="1" Margin="0,0,0,8" Text="{Binding FirstName, UpdateSourceTrigger=PropertyChanged}" />

            <TextBlock Grid.Row="3" Grid.Column="0" Margin="0,0,12,8" VerticalAlignment="Center" Text="Отчество" />
            <TextBox Grid.Row="3" Grid.Column="1" Margin="0,0,0,8" Text="{Binding Patronymic, UpdateSourceTrigger=PropertyChanged}" />

            <TextBlock Grid.Row="4" Grid.Column="0" Margin="0,0,12,8" VerticalAlignment="Center" Text="Телефон" />
            <TextBox Grid.Row="4" Grid.Column="1" Margin="0,0,0,8" Text="{Binding Phone, UpdateSourceTrigger=PropertyChanged}" />

            <TextBlock Grid.Row="5" Grid.Column="0" Margin="0,0,12,8" VerticalAlignment="Center" Text="E-mail" />
            <TextBox Grid.Row="5" Grid.Column="1" Margin="0,0,0,8" Text="{Binding Email, UpdateSourceTrigger=PropertyChanged}" />

            <TextBlock Grid.Row="6" Grid.Column="0" Margin="0,0,12,8" VerticalAlignment="Center" Text="GUID персоны" />
            <TextBox Grid.Row="6" Grid.Column="1" Margin="0,0,0,8" Text="{Binding Guid, UpdateSourceTrigger=PropertyChanged}" />

            <TextBlock Grid.Row="7" Grid.Column="0" Margin="0,0,12,8" VerticalAlignment="Top" Text="Доп. сведения" />
            <TextBox Grid.Row="7" Grid.Column="1" Margin="0,0,0,8" AcceptsReturn="True" VerticalScrollBarVisibility="Auto" TextWrapping="Wrap" Text="{Binding Notes, UpdateSourceTrigger=PropertyChanged}" />

            <TextBlock Grid.Row="8" Grid.Column="0" Margin="0,0,12,0" VerticalAlignment="Center" Text="Доп. идентификатор" />
            <TextBox Grid.Row="8" Grid.Column="1" Text="{Binding ExternalId, UpdateSourceTrigger=PropertyChanged}" />
        </Grid>

        <TextBlock Grid.Row="1" Margin="0,12,0,0" Foreground="Firebrick" Text="{Binding ValidationMessage}" />

        <StackPanel Grid.Row="2" Margin="0,12,0,0" Orientation="Horizontal" HorizontalAlignment="Right">
            <Button Width="100" Margin="0,0,8,0" IsDefault="True" Command="{Binding ConfirmCommand}" Content="Сохранить" />
            <Button Width="90" Command="{Binding CancelCommand}" Content="Отмена" />
        </StackPanel>
    </Grid>
</Window>
