Compare commits

..

6 Commits

Author SHA1 Message Date
7813a448f9 Merge remote-tracking branch 'origin/feature/kylian'
# Conflicts:
#	MauiAppStock/Data/Database.cs
#	MauiAppStock/Views/AddPiecePage.xaml
#	MauiAppStock/Views/AddPiecePage.xaml.cs
#	MauiAppStock/Views/EditPiecePage.xaml
#	MauiAppStock/Views/EditPiecePage.xaml.cs
2025-05-09 23:43:03 +02:00
05922d3e78 Merge remote-tracking branch 'origin/feature/yann'
# Conflicts:
#	MauiAppStock/Views/MainPage.xaml
2025-05-09 23:42:18 +02:00
0141e811cf StockEntry should be removed due to the fact that it will be only modified by the movement of the stock 2025-05-06 11:38:44 +02:00
96792c02d9 Ajout picker fournisseurs dans AddPiece et EditPiece 2025-04-10 16:00:40 +02:00
a2f833d35d push de Fournisseur + base de style (logo bou
tons)
2025-04-08 11:55:53 +02:00
8d8578a059 Ajout :
- Suivi des mouvements stocks (table, crud, vue)
- Placeholder pour picker fournisseur (vue)
- Historique des mouvements stock (vue)
2025-04-08 11:21:14 +02:00
24 changed files with 584 additions and 17 deletions

View File

@ -20,6 +20,7 @@ namespace MauiAppStock.Data
await db.CreateTableAsync<Appareil>();
await db.CreateTableAsync<Piece>();
await db.CreateTableAsync<AppareilPiece>(); // Table de liaison
await db.CreateTableAsync<Fournisseur>();
}
}
@ -65,6 +66,29 @@ namespace MauiAppStock.Data
return db.DeleteAsync(piece);
}
// CRUD pour Fournisseur
public static Task<int> AddFournisseurAsync(Fournisseur fournisseur)
{
return db.InsertAsync(fournisseur);
}
public static Task<List<Fournisseur>> GetFournisseursAsync()
{
return db.Table<Fournisseur>().ToListAsync();
}
public static Task<int> UpdateFournisseursync(Fournisseur fournisseur)
{
return db.UpdateAsync(fournisseur);
}
public static Task<int> DeleteFournisseurAsync(Fournisseur fournisseur)
{
return db.DeleteAsync(fournisseur);
}
// Liaison entre Appareil et Piece
public static Task<int> AddAppareilPieceAsync(AppareilPiece appareilPiece)
{

View File

@ -9,5 +9,12 @@ namespace MauiAppStock.Models
public string Nom { get; set; }
public string Description { get; set; }
// Vous pouvez ajouter d'autres propriétés (stock, historique, etc.)
public override string ToString()
{
return $"{Nom}";
}
}
}

View File

@ -0,0 +1,13 @@
using SQLite;
namespace MauiAppStock.Models
{
public class Fournisseur
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
public string Nom { get; set; }
public string Numtel { get; set; }
}
}

View File

@ -0,0 +1,32 @@
using SQLite;
namespace MauiAppStock.Models
{
public class MouvementStock
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
public int PieceId { get; set; }
public DateTime DateMouvement { get; set; }
public TypeMouvement Type { get; set; }
public int Quantite { get; set; } // Number of parts moved
public string? Commentaire { get; set; }
[Ignore]
public string NomPiece { get; set; }
[Ignore]
public bool HasComment => !string.IsNullOrWhiteSpace(Commentaire);
}
public enum TypeMouvement
{
EntreeStock, // Parts entering stock (purchase)
SortieReparation // Parts used for repair
}
}

View File

@ -6,13 +6,17 @@ namespace MauiAppStock.Models
{
[PrimaryKey, AutoIncrement]
public int Id { get; set; }
public string Nom { get; set; }
public string Description { get; set; }
public string? Nom { get; set; }
public string? Description { get; set; }
public double Prix { get; set; }
public int Stock { get; set; }
public string Fournisseur { get; set; }
public string? Fournisseur { get; set; }
// public int Appareil { get; set; }
[Ignore]
public bool EstRecommandee { get; set; }
public string DetailView { get { return " ID : " + Id + @" - " + Description; } }
}
}

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<application android:allowBackup="true" android:icon="@mipmap/appicon" android:roundIcon="@mipmap/appicon_round" android:supportsRtl="true"></application>
<application android:allowBackup="true" android:icon="@mipmap/image" android:roundIcon="@mipmap/image" android:supportsRtl="true"></application>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
</manifest>

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 98 KiB

View File

@ -0,0 +1,42 @@
using System.Collections.ObjectModel;
using System.Threading.Tasks;
using System.Windows.Input;
using MauiAppStock.Models;
using MauiAppStock.Data;
using MauiAppStock.Helpers;
namespace MauiAppStock.ViewModels
{
public class FournisseursViewModel : BaseViewModel
{
public ObservableCollection<Fournisseur> Fournisseurs { get; set; }
public ICommand LoadFournisseursCommand { get; }
public ICommand DeleteFournisseurCommand { get; }
public FournisseursViewModel()
{
Fournisseurs = new ObservableCollection<Fournisseur>();
LoadFournisseursCommand = new AsyncCommand(LoadFournisseurs);
DeleteFournisseurCommand = new AsyncCommand<Fournisseur>(DeleteFournisseur);
}
private async Task LoadFournisseurs()
{
Fournisseurs.Clear();
var fournisseursList = await Database.GetFournisseursAsync();
foreach (var fournisseur in fournisseursList)
{
Fournisseurs.Add(fournisseur);
}
}
private async Task DeleteFournisseur(Fournisseur fournisseur)
{
if (fournisseur != null)
{
await Database.DeleteFournisseurAsync(fournisseur);
Fournisseurs.Remove(fournisseur);
}
}
}
}

View File

@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage x:Class="MauiAppStock.Views.AddFournisseurPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<StackLayout Padding="10">
<Label Text="Ajouter un Fournisseur" FontSize="24" HorizontalOptions="Center"/>
<Entry x:Name="NomEntry" Placeholder="Nom"/>
<Entry x:Name="NumEntry" Placeholder="NumTel" Keyboard="Numeric"/>
<Button Text="Enregistrer" Clicked="OnSaveClicked"/>
</StackLayout>
</ContentPage>

View File

@ -0,0 +1,29 @@
using MauiAppStock.Models;
using MauiAppStock.Data;
namespace MauiAppStock.Views
{
public partial class AddFournisseurPage : ContentPage
{
public AddFournisseurPage()
{
InitializeComponent();
}
private async void OnSaveClicked(object sender, EventArgs e)
{
{
var fournisseur = new Fournisseur
{
Nom = NomEntry.Text,
Numtel = NumEntry.Text
}
;
await Database.AddFournisseurAsync(fournisseur);
await Navigation.PopAsync();
}
}
}
}

View File

@ -4,11 +4,15 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<StackLayout Padding="10">
<Label Text="Ajouter une Pièce" FontSize="24" HorizontalOptions="Center"/>
<Entry x:Name="NomEntry" Placeholder="Nom"/>
<Editor x:Name="DescriptionEditor" Placeholder="Description" HeightRequest="100"/>
<Entry x:Name="PrixEntry" Placeholder="Prix" Keyboard="Numeric"/>
<Entry x:Name="StockEntry" Placeholder="Stock" Keyboard="Numeric"/>
<Entry x:Name="FournisseurEntry" Placeholder="Fournisseur"/>
<Label Text="Sélectionnez un fournisseur:"/>
<Picker x:Name="FournisseurPicker" Title="Fournisseurs"/>
<Button Text="Enregistrer" Clicked="OnSaveClicked"/>
</StackLayout>
</ContentPage>

View File

@ -1,27 +1,42 @@
using MauiAppStock.Models;
using MauiAppStock.Data;
using System.Collections.Generic;
using System.Linq;
namespace MauiAppStock.Views
{
public partial class AddPiecePage : ContentPage
{
private List<Fournisseur> _fournisseurs;
public AddPiecePage()
{
InitializeComponent();
LoadFournisseurs();
}
private async void LoadFournisseurs()
{
_fournisseurs = await Database.GetFournisseursAsync();
FournisseurPicker.ItemsSource = _fournisseurs;
FournisseurPicker.ItemDisplayBinding = new Binding("Nom");
}
private async void OnSaveClicked(object sender, EventArgs e)
{
if (double.TryParse(PrixEntry.Text, out double prix) && int.TryParse(StockEntry.Text, out int stock))
{
var selectedFournisseur = FournisseurPicker.SelectedItem as Fournisseur;
var piece = new Piece
{
Nom = NomEntry.Text,
Description = DescriptionEditor.Text,
Prix = prix,
Stock = stock,
Fournisseur = FournisseurEntry.Text
Fournisseur = selectedFournisseur?.Nom
};
await Database.AddPieceAsync(piece);
await Navigation.PopAsync();
}

View File

@ -4,11 +4,15 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<StackLayout Padding="10">
<Label Text="Modifier la Pièce" FontSize="24" HorizontalOptions="Center"/>
<Entry x:Name="NomEntry" Placeholder="Nom"/>
<Editor x:Name="DescriptionEditor" Placeholder="Description" HeightRequest="100"/>
<Entry x:Name="PrixEntry" Placeholder="Prix" Keyboard="Numeric"/>
<Entry x:Name="StockEntry" Placeholder="Stock" Keyboard="Numeric"/>
<Entry x:Name="FournisseurEntry" Placeholder="Fournisseur"/>
<Label Text="Sélectionnez un fournisseur:"/>
<Picker x:Name="FournisseurPicker" Title="Fournisseurs"/>
<Button Text="Enregistrer" Clicked="OnSaveClicked"/>
<Button Text="Supprimer" Clicked="OnDeleteClicked" TextColor="Red"/>
</StackLayout>

View File

@ -6,15 +6,39 @@ namespace MauiAppStock.Views
public partial class EditPiecePage : ContentPage
{
private Piece _piece;
private List<Fournisseur> _fournisseurs;
public EditPiecePage(Piece piece)
{
InitializeComponent();
_piece = piece;
// Remplir les champs de base
NomEntry.Text = piece.Nom;
DescriptionEditor.Text = piece.Description;
PrixEntry.Text = piece.Prix.ToString();
StockEntry.Text = piece.Stock.ToString();
FournisseurEntry.Text = piece.Fournisseur;
}
protected override async void OnAppearing()
{
base.OnAppearing();
// Charger les fournisseurs
_fournisseurs = await Database.GetFournisseursAsync();
FournisseurPicker.ItemsSource = _fournisseurs;
FournisseurPicker.ItemDisplayBinding = new Binding("Nom");
// Sélectionner le fournisseur existant (si défini)
if (!string.IsNullOrEmpty(_piece.Fournisseur))
{
var fournisseurActuel = _fournisseurs.FirstOrDefault(f => f.Nom == _piece.Fournisseur);
if (fournisseurActuel != null)
{
FournisseurPicker.SelectedItem = fournisseurActuel;
}
}
}
private async void OnSaveClicked(object sender, EventArgs e)
@ -25,7 +49,10 @@ namespace MauiAppStock.Views
_piece.Description = DescriptionEditor.Text;
_piece.Prix = prix;
_piece.Stock = stock;
// _piece.Fournisseur = SelectedFournisseur;
var fournisseurSelectionne = FournisseurPicker.SelectedItem as Fournisseur;
_piece.Fournisseur = fournisseurSelectionne?.Nom;
await Database.UpdatePieceAsync(_piece);
await Navigation.PopAsync();
}

View File

@ -0,0 +1,29 @@
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage
x:Class="MauiAppStock.Views.FournisseursPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:vm="clr-namespace:MauiAppStock.ViewModels">
<ContentPage.BindingContext>
<vm:FournisseursViewModel/>
</ContentPage.BindingContext>
<ContentPage.ToolbarItems>
<ToolbarItem Text="+" Clicked="OnAddFournisseurClicked"/>
</ContentPage.ToolbarItems>
<StackLayout Padding="10">
<Label Text="Liste des Fournisseurs" FontSize="24" HorizontalOptions="Center"/>
<ListView x:Name="FournisseursListView" ItemsSource="{Binding Fournisseurs}"
IsPullToRefreshEnabled="True"
RefreshCommand="{Binding LoadFournisseursCommand}"
>
<ListView.ItemTemplate>
<DataTemplate>
<TextCell Text="{Binding Nom}"/>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
</StackLayout>
</ContentPage>

View File

@ -0,0 +1,26 @@
using MauiAppStock.Models;
using MauiAppStock.ViewModels;
namespace MauiAppStock.Views
{
public partial class FournisseursPage : ContentPage
{
public FournisseursPage()
{
InitializeComponent();
}
protected override void OnAppearing()
{
base.OnAppearing();
var viewModel = BindingContext as FournisseursViewModel;
viewModel.LoadFournisseursCommand.Execute(null);
}
private async void OnAddFournisseurClicked(object sender, EventArgs e)
{
// Navigation vers la page d'ajout
await Navigation.PushAsync(new AddFournisseurPage());
}
}
}

View File

@ -2,7 +2,19 @@
<ContentPage x:Class="MauiAppStock.Views.MainPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml">
<VerticalStackLayout Padding="10" Spacing="10" >
<Label Text="Bienvenue sur le site : AppStock" FontSize="20"/>
</VerticalStackLayout>
<StackLayout Padding="20" Spacing="20" VerticalOptions="Center">
<Label Text="Menu Principal" FontSize="30" HorizontalOptions="Center" />
<Button Text="Gestion des Appareils" BackgroundColor="Black" Clicked="OnAppareilsClicked" />
<Button Text="Gestion des Pièces" BackgroundColor="Black" Clicked="OnPiecesClicked" />
<Button Text="Gestion des Fournisseurs" BackgroundColor="Black" Clicked="OnFournisseursClicked" />
<Button Text="Associer une Pièce à un Appareil" BackgroundColor="Black" Clicked="OnAssocierPieceClicked" />
<VerticalStackLayout Padding="20" Spacing="20">
<Image Source="logo.png"
HeightRequest="200"
Aspect="AspectFit" />
</VerticalStackLayout>
</StackLayout>
</ContentPage>

View File

@ -20,10 +20,21 @@ namespace MauiAppStock.Views
await Navigation.PushAsync(new PiecesPage());
}
private async void OnFournisseursClicked(object sender, EventArgs e)
{
await Navigation.PushAsync(new FournisseursPage());
}
private async void OnAssocierPieceClicked(object sender, EventArgs e)
{
// On navigue vers une page qui permet de sélectionner un appareil pour ensuite associer une pièce.
await Navigation.PushAsync(new SelectAppareilForAssociationPage());
}
private async void OnMouvementStockClicked(object sender, EventArgs e)
{
await Navigation.PushAsync(new MouvementStockPage());
}
}
}

View File

@ -0,0 +1,60 @@
<?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="MauiAppStock.Views.MouvementStockHistoryPage"
Title="Historique des Mouvements">
<Grid RowDefinitions="Auto,*">
<VerticalStackLayout Grid.Row="0" Spacing="10" Padding="20">
<Label Text="Historique des Mouvements de Stock"
SemanticProperties.HeadingLevel="Level1"
FontSize="24"
HorizontalOptions="Center" />
<Picker x:Name="FilterPicker"
Title="Filtrer par type"
SelectedIndexChanged="OnFilterChanged">
<Picker.Items>
<x:String>Tous</x:String>
<x:String>Entrée Stock</x:String>
<x:String>Sortie Réparation</x:String>
</Picker.Items>
</Picker>
</VerticalStackLayout>
<CollectionView Grid.Row="1"
x:Name="MouvementsCollection"
SelectionMode="None">
<CollectionView.ItemTemplate>
<DataTemplate>
<Frame Margin="10" Padding="10">
<Grid ColumnDefinitions="*,Auto" RowDefinitions="Auto,Auto,Auto">
<Label Text="{Binding NomPiece}"
FontSize="16"
FontAttributes="Bold"
Grid.Column="0"
Grid.Row="0"/>
<Label Text="{Binding DateMouvement, StringFormat='{0:dd/MM/yyyy HH:mm}'}"
Grid.Column="1"
Grid.Row="0"/>
<Label Text="{Binding Type, StringFormat='Type: {0}'}"
Grid.Column="0"
Grid.Row="1"/>
<Label Text="{Binding Quantite, StringFormat='Quantité: {0}'}"
Grid.Column="1"
Grid.Row="1"/>
<Label Text="{Binding Commentaire}"
Grid.Column="0"
Grid.ColumnSpan="2"
Grid.Row="2"
IsVisible="{Binding HasComment}"/>
</Grid>
</Frame>
</DataTemplate>
</CollectionView.ItemTemplate>
</CollectionView>
</Grid>
</ContentPage>

View File

@ -0,0 +1,60 @@
using MauiAppStock.Models;
using MauiAppStock.Data;
namespace MauiAppStock.Views;
public partial class MouvementStockHistoryPage : ContentPage
{
private List<MouvementStock> allMouvements;
private List<Piece> pieces;
public MouvementStockHistoryPage()
{
InitializeComponent();
LoadData();
}
private async void LoadData()
{
try
{
// Load all pieces to get their names
pieces = await Database.GetPiecesAsync();
// Load all movements
allMouvements = await Database.GetMouvementsStockAsync();
// Add piece names to movements
foreach (var mouvement in allMouvements)
{
var piece = pieces.FirstOrDefault(p => p.Id == mouvement.PieceId);
if (piece != null)
{
mouvement.NomPiece = piece.Nom;
}
}
// Display all movements initially
MouvementsCollection.ItemsSource = allMouvements;
}
catch (Exception ex)
{
await DisplayAlert("Erreur", "Impossible de charger l'historique: " + ex.Message, "OK");
}
}
private void OnFilterChanged(object sender, EventArgs e)
{
if (allMouvements == null) return;
var selectedIndex = FilterPicker.SelectedIndex;
var filteredMouvements = selectedIndex switch
{
1 => allMouvements.Where(m => m.Type == TypeMouvement.EntreeStock).ToList(),
2 => allMouvements.Where(m => m.Type == TypeMouvement.SortieReparation).ToList(),
_ => allMouvements
};
MouvementsCollection.ItemsSource = filteredMouvements;
}
}

View File

@ -0,0 +1,55 @@
<?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="MauiAppStock.Views.MouvementStockPage"
Title="Mouvement de Stock">
<ScrollView>
<VerticalStackLayout Spacing="10" Padding="20">
<Label Text="Mouvement de Stock"
SemanticProperties.HeadingLevel="Level1"
FontSize="24"
HorizontalOptions="Center" />
<Button Text="Voir l'historique"
Clicked="OnViewHistoryClicked"
HorizontalOptions="End" />
<Picker x:Name="TypeMouvementPicker"
Title="Type de Mouvement">
<Picker.Items>
<x:String>Entrée Stock</x:String>
<x:String>Sortie Réparation</x:String>
</Picker.Items>
</Picker>
<Picker x:Name="PiecePicker"
Title="Sélectionner une pièce"
ItemDisplayBinding="{Binding Nom}"
SelectedIndexChanged="OnPieceSelected"/>
<Label Text="Quantité:"
SemanticProperties.HeadingLevel="Level2"/>
<Entry x:Name="QuantiteEntry"
Keyboard="Numeric"
Placeholder="Entrez la quantité"/>
<Label Text="Commentaire:"
SemanticProperties.HeadingLevel="Level2"/>
<Editor x:Name="CommentaireEditor"
Placeholder="Ajouter un commentaire"
HeightRequest="100"/>
<Button x:Name="SaveButton"
Text="Enregistrer"
SemanticProperties.Hint="Enregistre le mouvement de stock"
Clicked="OnSaveClicked"
HorizontalOptions="Center" />
<Button x:Name="CancelButton"
Text="Annuler"
SemanticProperties.Hint="Annule l'opération"
Clicked="OnCancelClicked"
HorizontalOptions="Center" />
</VerticalStackLayout>
</ScrollView>
</ContentPage>

View File

@ -0,0 +1,101 @@
using MauiAppStock.Models;
using MauiAppStock.Data;
namespace MauiAppStock.Views;
public partial class MouvementStockPage : ContentPage
{
private List<Piece> pieces;
private Piece selectedPiece;
public MouvementStockPage()
{
InitializeComponent();
LoadData();
}
private async void LoadData()
{
try
{
pieces = await Database.GetPiecesAsync();
PiecePicker.ItemsSource = pieces;
}
catch (Exception ex)
{
await DisplayAlert("Erreur", "Impossible de charger les données: " + ex.Message, "OK");
}
}
private void OnPieceSelected(object sender, EventArgs e)
{
if (PiecePicker.SelectedItem != null)
{
selectedPiece = (Piece)PiecePicker.SelectedItem;
}
}
private async void OnViewHistoryClicked(object sender, EventArgs e)
{
await Navigation.PushAsync(new MouvementStockHistoryPage());
}
private async void OnSaveClicked(object sender, EventArgs e)
{
if (selectedPiece == null)
{
await DisplayAlert("Erreur", "Veuillez sélectionner une pièce", "OK");
return;
}
if (!int.TryParse(QuantiteEntry.Text, out int quantite) || quantite <= 0)
{
await DisplayAlert("Erreur", "Veuillez entrer une quantité valide", "OK");
return;
}
try
{
// Create new stock movement
var mouvement = new MouvementStock
{
PieceId = selectedPiece.Id,
DateMouvement = DateTime.Now,
Type = TypeMouvementPicker.SelectedIndex == 0 ? TypeMouvement.EntreeStock : TypeMouvement.SortieReparation,
Quantite = quantite,
Commentaire = CommentaireEditor.Text
};
// Update piece stock
if (TypeMouvementPicker.SelectedIndex == 0)
{
selectedPiece.Stock += quantite;
}
else
{
if (selectedPiece.Stock < quantite)
{
await DisplayAlert("Erreur", "Stock insuffisant", "OK");
return;
}
selectedPiece.Stock -= quantite;
}
// Save changes using Database class
await Database.AddMouvementStockAsync(mouvement);
await Database.UpdatePieceAsync(selectedPiece);
await DisplayAlert("Succès", "Mouvement de stock enregistré", "OK");
await Navigation.PopAsync();
}
catch (Exception ex)
{
await DisplayAlert("Erreur", "Impossible d'enregistrer le mouvement: " + ex.Message, "OK");
}
}
private async void OnCancelClicked(object sender, EventArgs e)
{
await Navigation.PopAsync();
}
}

View File

@ -1,4 +1,5 @@
<?xml version="1.0" encoding="utf-8" ?>
<?xml version="1.0" encoding="utf-8"?>
<ContentPage x:Class="MauiAppStock.Views.PiecesPage"
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
@ -7,17 +8,17 @@
<vm:PiecesViewModel />
</ContentPage.BindingContext>
<ContentPage.ToolbarItems>
<ToolbarItem Text="+" Clicked="OnAddPieceClicked"/>
<ToolbarItem Text="+" Clicked="OnAddPieceClicked" />
</ContentPage.ToolbarItems>
<StackLayout Padding="10">
<Label Text="Liste des Pièces" FontSize="24" HorizontalOptions="Center"/>
<Label Text="Liste des Pièces" FontSize="24" HorizontalOptions="Center" />
<ListView x:Name="PiecesListView" ItemsSource="{Binding Pieces}"
IsPullToRefreshEnabled="True"
RefreshCommand="{Binding LoadPiecesCommand}"
ItemTapped="OnPieceTapped">
<ListView.ItemTemplate>
<DataTemplate>
<TextCell Text="{Binding Nom}" Detail="{Binding Description}"/>
<TextCell Text="{Binding Nom}" Detail="{Binding DetailView}" />
</DataTemplate>
</ListView.ItemTemplate>
</ListView>