<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="Views.Especes"
             Title="Wikipet's">
    <ScrollView>
        <Grid RowDefinitions="Auto, *" 
              RowSpacing="20">
            <!-- To display the list of species -->
            <ListView ItemsSource="{Binding ListeEspeces}" 
                      Grid.Row="1"
                      ItemTapped="OnClick">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell>
                            <Grid Margin="0,10,0,10">
                                <Border>
                                    <Grid ColumnDefinitions="Auto, *" 
                                          RowDefinitions="3*"
                                          ColumnSpacing="15">
                                        <!-- To display the image -->
                                        <Frame Grid.RowSpan="3">
                                            <Image Source="{Binding Image}"/>
                                        </Frame>
                                        <VerticalStackLayout Grid.Column="1">
                                            <!-- To display the species' name -->
                                            <Label Text="{Binding Nom}" 
                                                   FontSize="Large"/>
                                            <!-- To display the species' scientific name -->
                                            <Label Text="{Binding NomScientifique}"
                                                   FontSize="12"
                                                   FontFamily="Raleway"/>
                                        </VerticalStackLayout>
                                    </Grid>
                                </Border>
                            </Grid>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>
        </Grid>
    </ScrollView>
</ContentPage>