<Page x:Class="SASDesktop.Views.Drivers.Create"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
      xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
      xmlns:local="clr-namespace:SASDesktop.Views.Drivers" xmlns:drivers="clr-namespace:SASDesktop.ViewModels.Drivers" d:DataContext="{d:DesignInstance Type=drivers:Create}"
      mc:Ignorable="d" 
      d:DesignHeight="800" d:DesignWidth="800"
      Title="Create">
    <!--Страница создания водителя-->
    <ScrollViewer>
        <StackPanel
            CanVerticallyScroll="True"
            Style="{StaticResource FormContainer}">
        
            <TextBlock 
                HorizontalAlignment="Center"
                Style="{StaticResource H2}"
                Text="Создание водителя"/>
        
            <StackPanel Orientation="Vertical">

                <!--ФИО-->
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>

                    <!--Фамилия-->
                    <StackPanel 
                        Grid.Column="0"
                        Margin="4">

                        <StackPanel Orientation="Horizontal">
                            <TextBlock Style="{StaticResource H5}" Text="Фамилия"/>
                            <Label Style="{StaticResource RequiredMark}" Margin="4,0,0,0"/>
                        </StackPanel>

                        <TextBox
                            Margin="0,4"
                            VerticalContentAlignment="Center"
                            Text="{Binding Surname}"/>
                    </StackPanel>

                    <!--Имя-->
                    <StackPanel 
                        Grid.Column="1"
                        Margin="4">

                        <StackPanel Orientation="Horizontal">
                            <TextBlock Style="{StaticResource H5}" Text="Имя"/>
                            <Label Style="{StaticResource RequiredMark}" Margin="4,0,0,0"/>
                        </StackPanel>

                        <TextBox
                            Margin="0,4"
                            VerticalContentAlignment="Center"
                            Text="{Binding Name}"/>
                    </StackPanel>

                    <!--Отчество-->
                    <StackPanel 
                        Grid.Column="2"
                        Margin="4">

                        <StackPanel Orientation="Horizontal">
                            <TextBlock Style="{StaticResource H5}" Text="Отчество"/>
                        </StackPanel>

                        <TextBox
                            Margin="0,4"
                            VerticalContentAlignment="Center"
                            Text="{Binding Patron}"/>
                    </StackPanel>
                </Grid>

                <!--Паспорт-->
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>

                    <!--Серия-->
                    <StackPanel 
                        Grid.Column="0"
                        Margin="4">

                        <StackPanel Orientation="Horizontal">
                            <TextBlock Style="{StaticResource H5}" Text="Серия паспорта"/>
                            <Label Style="{StaticResource RequiredMark}" Margin="4,0,0,0"/>
                        </StackPanel>

                        <TextBox
                            Margin="0,4"
                            VerticalContentAlignment="Center"
                            Text="{Binding PassSeries}"/>
                    </StackPanel>

                    <!--Номер-->
                    <StackPanel 
                        Grid.Column="1"
                        Margin="4">

                        <StackPanel Orientation="Horizontal">
                            <TextBlock Style="{StaticResource H5}" Text="Номер паспорта"/>
                            <Label Style="{StaticResource RequiredMark}" Margin="4,0,0,0"/>
                        </StackPanel>

                        <TextBox
                            Margin="0,4"
                            VerticalContentAlignment="Center"
                            Text="{Binding PassNumber}"/>
                    </StackPanel>
                </Grid>

                <!--Адреса-->
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>

                    <!--Адрес регистрации-->
                    <StackPanel 
                        Grid.Column="0"
                        Margin="4">
                            <StackPanel Orientation="Horizontal">
                            <TextBlock Style="{StaticResource H5}" Text="Адрес регистрации"/>
                            <Label Style="{StaticResource RequiredMark}" Margin="4,0,0,0"/>
                        </StackPanel>

                        <TextBox
                            TextWrapping="Wrap"
                            Height="64"
                            AcceptsReturn="True"
                            Margin="0,4"
                            VerticalContentAlignment="Top"
                            Text="{Binding AddrRegistration}"/>
                    </StackPanel>

                    <!--Адрес проживания-->
                    <StackPanel 
                        Grid.Column="1"
                        Margin="4">

                        <StackPanel Orientation="Horizontal">
                            <TextBlock Style="{StaticResource H5}" Text="Адрес проживания"/>
                            <Label Style="{StaticResource RequiredMark}" Margin="4,0,0,0"/>
                        </StackPanel>

                        <TextBox
                            Height="64"
                            Margin="0,4"
                            VerticalContentAlignment="Top"
                            Text="{Binding AddrLiving}"/>
                    </StackPanel>

                    <!--Почтовый индекс-->
                    <StackPanel 
                        Grid.Column="2"
                        Margin="4">

                        <StackPanel Orientation="Horizontal">
                            <TextBlock Style="{StaticResource H5}" Text="Почтовый индекс"/>
                            <Label Style="{StaticResource RequiredMark}" Margin="4,0,0,0"/>
                        </StackPanel>

                        <TextBox
                            Margin="0,4"
                            VerticalContentAlignment="Center"
                            Text="{Binding MailIndex}"/>
                    </StackPanel>
                </Grid>

                <!--Работа-->
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>

                    <!--Место работы-->
                    <StackPanel 
                        Grid.Column="0"
                        Margin="4">

                        <StackPanel Orientation="Horizontal">
                            <TextBlock Style="{StaticResource H5}" Text="Место работы"/>
                        </StackPanel>

                        <TextBox
                            Margin="0,4"
                            VerticalContentAlignment="Center"
                            Text="{Binding Company}"/>
                    </StackPanel>

                    <!--Должность-->
                    <StackPanel 
                        Grid.Column="1"
                        Margin="4">

                        <StackPanel Orientation="Horizontal">
                            <TextBlock Style="{StaticResource H5}" Text="Должность"/>
                        </StackPanel>

                        <TextBox
                            Margin="0,4"
                            VerticalContentAlignment="Center"
                            Text="{Binding JobPosition}"/>
                    </StackPanel>
                </Grid>

                <!--Контакты-->
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>

                    <!--Телефон-->
                    <StackPanel 
                        Grid.Column="0"
                        Margin="4">

                        <StackPanel Orientation="Horizontal">
                            <TextBlock Style="{StaticResource H5}" Text="Телефон"/>
                        </StackPanel>

                        <TextBox
                            Margin="0,4"
                            VerticalContentAlignment="Center"
                            Text="{Binding Phone}"/>
                    </StackPanel>

                    <!--Адрес email-->
                    <StackPanel 
                        Grid.Column="1"
                        Margin="4">

                        <StackPanel Orientation="Horizontal">
                            <TextBlock Style="{StaticResource H5}" Text="Адрес email"/>
                        </StackPanel>

                        <TextBox
                            Margin="0,4"
                            VerticalContentAlignment="Center"
                            Text="{Binding EmailAddr}"/>
                    </StackPanel>
                </Grid>

                <!--Фотография & примечания-->
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="200"/>
                        <ColumnDefinition Width="*"/>
                    </Grid.ColumnDefinitions>
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto"/>
                        <RowDefinition Height="230"/>
                        <RowDefinition Height="32"/>
                    </Grid.RowDefinitions>

                    <Border
                        BorderBrush="Black"
                        Grid.Column="0" 
                        Grid.RowSpan="2"
                        BorderThickness="1">
                        <Image Source="{Binding PhotoPath}"/>
                    </Border>
                    <Button 
                        Margin="0,4"
                        Content="Загрузить фото (3 на 4)" 
                        Grid.Column="0" 
                        Command="{Binding ChoosePhotoCmd}"
                        Grid.Row="2"/>

                    <TextBlock
                        Text="Примечания"
                        Grid.Column="1"
                        HorizontalAlignment="Center"
                        Style="{StaticResource H3}"/>
                    <TextBox
                        AcceptsReturn="True"
                        Grid.Column="1"
                        Margin="4,0,0,0"
                        Text="{Binding Comment}"
                        Grid.Row="1"/>
                </Grid>
            
                <!--Сохранить/отмена-->
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="128"/>
                        <ColumnDefinition Width="128"/>
                    </Grid.ColumnDefinitions>
                    <Button 
                    Grid.Column="1"
                    Command="{Binding CancelCmd}"
                    Margin="4">Отмена</Button>
                    <Button 
                    Grid.Column="2"
                    Command="{Binding SubmitCmd}"
                    Margin="4">Сохранить</Button>
                </Grid>
                
            </StackPanel>
        </StackPanel>
    </ScrollViewer>
</Page>
