AppSAV/MauiApp1/Views/FournisseurPage.xaml

48 lines
2.1 KiB
Plaintext
Raw Normal View History

<?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="MauiApp1.Views.FournisseurPage"
Title="Fournisseurs">
<Grid RowDefinitions="Auto,*">
<!-- Bouton Ajouter -->
<Button Grid.Row="0"
Text="Ajouter un fournisseur"
Clicked="OnAddFournisseurClicked"
Margin="10"/>
<!-- Liste des fournisseurs -->
<CollectionView Grid.Row="1"
x:Name="FournisseursList"
ItemsSource="{Binding ItemsSource}" x:FieldModifier="public">
<CollectionView.ItemTemplate>
<DataTemplate>
<SwipeView>
<SwipeView.RightItems>
<SwipeItems>
<SwipeItem Text="Modifier"
BackgroundColor="Orange"
Clicked="OnEditFournisseur"/>
<SwipeItem Text="Supprimer"
BackgroundColor="Red"
Clicked="OnDeleteFournisseur"/>
</SwipeItems>
</SwipeView.RightItems>
<Grid Padding="10" RowDefinitions="Auto,Auto,Auto,Auto">
<Label Grid.Row="0"
Text="{Binding Name}"
FontAttributes="Bold"/>
<Label Grid.Row="1"
Text="{Binding Email}"/>
<Label Grid.Row="2"
Text="{Binding Telephone}"/>
<Label Grid.Row="3"
Text="{Binding Address}"/>
</Grid>
</SwipeView>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ContentPage>