<Window x:Class="XLAB.CreateDocumentWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        Title="Новый ПСВ"
        Height="240"
        Width="430"
        ResizeMode="NoResize"
        WindowStartupLocation="CenterOwner">
    <Grid Margin="16">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="150" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>

        <TextBlock Grid.Row="0"
                   Grid.Column="0"
                   Margin="0,0,12,8"
                   VerticalAlignment="Center"
                   Text="Номер ПСВ" />
        <TextBox Grid.Row="0"
                 Grid.Column="1"
                 MinWidth="180"
                 Margin="0,0,0,8"
                 Text="{Binding DocumentNumber, UpdateSourceTrigger=PropertyChanged}" />

        <TextBlock Grid.Row="1"
                   Grid.Column="0"
                   Margin="0,0,12,8"
                   VerticalAlignment="Center"
                   Text="Дата приемки" />
        <DatePicker Grid.Row="1"
                    Grid.Column="1"
                    SelectedDate="{Binding AcceptedOn, Mode=TwoWay}"
                    SelectedDateFormat="Short"
                    Margin="0,0,0,8" />

        <TextBlock Grid.Row="2"
                   Grid.ColumnSpan="2"
                   Margin="0,8,0,4"
                   TextWrapping="Wrap"
                   Foreground="DimGray"
                   Text="ПСВ без строк EKZMK не хранится в базе. Команда «Добавить» создаёт только черновик текущего сеанса." />
        <TextBlock Grid.Row="3"
                   Grid.ColumnSpan="2"
                   Foreground="Firebrick"
                   Text="{Binding ValidationMessage}" />

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