<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
             xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
             x:Class="MaUI.ListeEmails"
             Title="Liste LOGS">
    <ScrollView>
        <StackLayout Padding="10" Spacing="10">
            <!-- Liste des Items -->
            <ListView 
                      ItemsSource="{Binding Liste_Items}"
                      SelectedItem="{Binding SelectedItem}">
                <ListView.ItemTemplate>
                    <DataTemplate>
                        <ViewCell>
                            <Grid Padding="10" ColumnDefinitions="*">
                                <Label Text="{Binding NIVEAU}" FontSize="16" VerticalOptions="Center" HorizontalOptions="Start" />
                            </Grid>
                        </ViewCell>
                    </DataTemplate>
                </ListView.ItemTemplate>
            </ListView>

            <!-- Boutons pour les opérations -->
            <StackLayout Orientation="Horizontal" Spacing="10">
                <Button Text="Créer" WidthRequest="120" Command="{Binding CreateCommand}" Background="Blue" />
                <Button Text="Modifier" WidthRequest="120" Command="{Binding EditCommand}" Background="Green" IsEnabled="{Binding SelectedItem}" />
                <Button Text="Supprimer" WidthRequest="120" Command="{Binding DeleteCommand}" Background="Red" IsEnabled="{Binding SelectedItem}" />
            </StackLayout>
        </StackLayout>
    </ScrollView>
</ContentPage>
