<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:model="clr-namespace:CanYouBuildIt.Model"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="CanYouBuildIt.Views.Acceuil"
             Title="Can You Build It"
             BackgroundColor="DarkTurquoise">

    <VerticalStackLayout>

        <Image Source="logoapp.png"
            MaximumHeightRequest="150"/>

        <Grid Margin="0,50,0,0">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="1"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            
            <Image Source="pc1.png"
                Grid.Row="0"  Grid.Column="0"
                HeightRequest="200"
            />
            <Image Source="pc3.png"
                Grid.Row="0"  Grid.Column="2" 
                HeightRequest="200"
            />
            <Image Source="pc3.png"
                Grid.Row="0"  Grid.Column="4" 
                HeightRequest="200"
            />
            <Image Source="pc2.png"
                Grid.Row="1"  Grid.Column="1" 
                HeightRequest="200"
            />
            <Image Source="pc4.png"
                Grid.Row="1"  Grid.Column="3" 
                HeightRequest="200"
            />
            <Image Source="pc2.png"
                Grid.Row="1"  Grid.Column="5" 
                HeightRequest="200"
            />

        </Grid>


        <Grid  Margin="0,250">

            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition />
            </Grid.RowDefinitions>

            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

            <Button BackgroundColor="DimGrey" 
                Clicked="AddUtilisater"
                Grid.Row="0" Grid.Column="2"
                HorizontalOptions="Center"
                Text="Configurateur"
                TextColor="Snow"
                x:Name="Config"/>

            <Button BackgroundColor="DimGrey"
                Clicked="NavFav"
                Grid.Row="0" Grid.Column="5"
                HorizontalOptions="Center"
                TextColor="Snow"
                x:Name="Fav"
                Text="Favoris"/>

            <ListView Grid.Row="1" Grid.Column="4"
                      ItemsSource="{Binding listUtil}"
                      x:Name="utilView">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <Label Text="{Binding username}"
                               TextColor="Black"/>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>

            <Button BackgroundColor="DimGrey"
                Clicked="ToQuit"
                Grid.Row="1" Grid.Column="1"
                HorizontalOptions="Center"
                Text="Quitter"
                TextColor="Snow"
                x:Name="Quit"/>
            
            <Button BackgroundColor="DimGrey"
                Clicked="NavCreds"
                Grid.Row="1" Grid.Column="6"
                HorizontalOptions="Center"
                Text="Credits"
                TextColor="Snow"
                x:Name="Creds"/>
            
        </Grid>
        
    </VerticalStackLayout>
</ContentPage>