<Page x:Class="SASDesktop.Views.Drivers.DriverListOutput"
      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:root="clr-namespace:SASDesktop"
      mc:Ignorable="d" 
      d:DesignHeight="600" d:DesignWidth="800"
      Title="DriverListOutput">
    <ScrollViewer>
        <StackPanel
            CanVerticallyScroll="True"
            Style="{StaticResource FormContainer}">

            <TextBlock HorizontalAlignment="Center"
                       Style="{StaticResource H2}"
                       Text="Список водителей"/>
                       
            <Grid>
                <StackPanel>

                  <StackPanel Orientation="Horizontal">
                      <Button Content="Добавить"
                              Style="{StaticResource StandartButton}"
                              Command="{Binding AddCmd}"/>
                      <Button Content="Редактировать"
                              Style="{StaticResource StandartButton}"
                              Command="{Binding EditCmd}"/>
                      <Button Content="Удалить"
                              Style="{StaticResource StandartButton}"
                              Command="{Binding DeleteCmd}"/>
                      <Button Content="Назад"
                              Style="{StaticResource StandartButton}"
                              Command="{Binding BackCmd}"/>
                    </StackPanel>
                    
                  <ListView ItemsSource="{Binding lvOutPutCitizen}" 
                            ScrollViewer.HorizontalScrollBarVisibility="Disabled"
                            Height="400">
                      <ListView.ItemsPanel>
                          <ItemsPanelTemplate>
                              <WrapPanel Orientation="Horizontal"/>
                          </ItemsPanelTemplate>
                      </ListView.ItemsPanel>
                      <ListView.ItemTemplate>
                          <DataTemplate>
                              <Grid>
                                  <Grid.ColumnDefinitions>
                                      <ColumnDefinition Width="*"/>
                                      <ColumnDefinition Width="*"/>
                                      <ColumnDefinition Width="*"/>
                                  </Grid.ColumnDefinitions>
                                  <StackPanel Width="160">
                                      <StackPanel Orientation="Horizontal">
                                          <TextBlock Text="{Binding GetHumanName}" 
                                                     Style="{StaticResource H4}"/>
                                      </StackPanel>
                                      <TextBlock Text="{Binding Path=GetHumanPass}"/>
                                      <TextBlock Text="{Binding Path=Job1.Name}"/>
                                      <TextBlock Text="{Binding Path=Job1.Company1.Name}"/>
                                      <Image
                                             Width="140"
                                             Height="140">
                                          <Image.Source>
                                              <Binding Path="GetFace">
                                                  <Binding.TargetNullValue>
                                                      <ImageSource>/Assets/BlackAvatar.png</ImageSource>
                                                  </Binding.TargetNullValue>
                                              </Binding>
                                          </Image.Source>
                                      </Image>
                                  </StackPanel>
                              </Grid>
                          </DataTemplate>
                      </ListView.ItemTemplate>
                  </ListView>
                </StackPanel>
            </Grid>
        </StackPanel>
    </ScrollViewer>
</Page>
