<?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="White"
             >

    <ContentPage.BindingContext>
        <model:Manager/>
    </ContentPage.BindingContext>
    
    <VerticalStackLayout Margin="0,15,0,0">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="1"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>
            
            <Image Grid.Row="0"  Grid.Column="0" 
                Source="pc1.png"
                HeightRequest="200"
            />
            <Image Grid.Row="0"  Grid.Column="2" 
                Source="pc3.png"
                HeightRequest="200"
            />
            <Image Grid.Row="0"  Grid.Column="4" 
                Source="pc3.png"
                HeightRequest="200"
            />
            <Image Grid.Row="1"  Grid.Column="1" 
                Source="pc2.png"
                HeightRequest="200"
            />
            <Image Grid.Row="1"  Grid.Column="3" 
                Source="pc4.png"
                HeightRequest="200"
            />
            <Image Grid.Row="1"  Grid.Column="5" 
                Source="pc2.png"
                HeightRequest="200"
            />

        </Grid>


        <Grid  Margin="0,250">
            <Grid.RowDefinitions>
                <RowDefinition />
                <RowDefinition Height="1"/>
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
                <ColumnDefinition />
            </Grid.ColumnDefinitions>

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

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

            <ListView Grid.Row="1" Grid.Column="1"
                      x:Name="utilView"
                      ItemsSource="{Binding listUtil}">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <Label Text="{Binding name}"/>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </Grid>
        
    </VerticalStackLayout>
</ContentPage>