diff --git a/Sources/BookApp/AppShell.xaml b/Sources/BookApp/AppShell.xaml
index 8ea0eb9..b124732 100644
--- a/Sources/BookApp/AppShell.xaml
+++ b/Sources/BookApp/AppShell.xaml
@@ -15,19 +15,21 @@
-
+
-
+
-
+
+
+
diff --git a/Sources/BookApp/AppShell.xaml.cs b/Sources/BookApp/AppShell.xaml.cs
index ce0183e..8f31430 100644
--- a/Sources/BookApp/AppShell.xaml.cs
+++ b/Sources/BookApp/AppShell.xaml.cs
@@ -10,7 +10,8 @@ namespace BookApp
Routing.RegisterRoute("FiltragePage", typeof(Filtrage));
Routing.RegisterRoute("TousPage", typeof(Tous));
Routing.RegisterRoute("Mainpage", typeof(MainPage));
- Routing.RegisterRoute("EmpruntsPrets", typeof(EmpruntsPrets));
+ Routing.RegisterRoute("EmpruntsPretsPage", typeof(EmpruntsPrets));
+ Routing.RegisterRoute("DetailBookPage", typeof(DetailBook));
}
}
}
diff --git a/Sources/BookApp/Composants/CollectionFiltrage.xaml b/Sources/BookApp/Composants/CollectionFiltrage.xaml
index 4daadf9..62bb13b 100644
--- a/Sources/BookApp/Composants/CollectionFiltrage.xaml
+++ b/Sources/BookApp/Composants/CollectionFiltrage.xaml
@@ -6,7 +6,7 @@
xmlns:model="clr-namespace:Model;assembly=Model"
x:DataType="vm:ViewModelManager"
x:Class="BookApp.Composants.CollectionFiltrage">
-
+
diff --git a/Sources/BookApp/Composants/GroupCollection.xaml b/Sources/BookApp/Composants/GroupCollection.xaml
index 79bcd7d..a64369e 100644
--- a/Sources/BookApp/Composants/GroupCollection.xaml
+++ b/Sources/BookApp/Composants/GroupCollection.xaml
@@ -2,6 +2,7 @@
-
+
@@ -116,9 +116,9 @@
+ SelectionMode="Single" Margin="25,0,0,0" BackgroundColor="#F9F9F9">
@@ -147,11 +147,10 @@
VerticalOptions="Center"
Margin="0,0,40,0"
HorizontalOptions="End"/>
-
diff --git a/Sources/BookApp/MauiProgram.cs b/Sources/BookApp/MauiProgram.cs
index 330d293..7e0c67c 100644
--- a/Sources/BookApp/MauiProgram.cs
+++ b/Sources/BookApp/MauiProgram.cs
@@ -36,6 +36,9 @@ namespace BookApp
builder.Services.AddSingleton();
builder.Services.AddSingleton();
builder.Services.AddSingleton();
+ builder.Services.AddSingleton();
+ builder.Services.AddSingleton();
+ builder.Services.AddSingleton();
builder.Services.AddTransient();
diff --git a/Sources/BookApp/Pages/DetailBook.xaml b/Sources/BookApp/Pages/DetailBook.xaml
index 94f3a1e..b10a8be 100644
--- a/Sources/BookApp/Pages/DetailBook.xaml
+++ b/Sources/BookApp/Pages/DetailBook.xaml
@@ -3,6 +3,7 @@
xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
+ xmlns:vm="clr-namespace:BookApp.ViewModel"
x:Class="BookApp.Pages.DetailBook">
@@ -18,7 +19,9 @@
Source="Chevron_left.svg"
HorizontalOptions="Start">
-
+
@@ -54,9 +57,9 @@
-
+
-
+
@@ -81,13 +84,13 @@
-
+
-
+
-
+
@@ -101,11 +104,11 @@
-
+
-
+
-
+
@@ -115,7 +118,7 @@
-
+
@@ -125,7 +128,7 @@
-
+
diff --git a/Sources/BookApp/Pages/DetailBook.xaml.cs b/Sources/BookApp/Pages/DetailBook.xaml.cs
index 561a6c0..a36b2ce 100644
--- a/Sources/BookApp/Pages/DetailBook.xaml.cs
+++ b/Sources/BookApp/Pages/DetailBook.xaml.cs
@@ -1,67 +1,14 @@
+using BookApp.ViewModel;
+using Model;
using System.Collections.ObjectModel;
namespace BookApp.Pages;
public partial class DetailBook : ContentPage
{
- /*private int maxStars = 5;
- private int currentRating = 0;
-
- public Book BookDetail { get; set; }
- */
- public DetailBook(Model.Book selectedItem) //Book ItemBook)
+ public DetailBook(ViewModelManager data)
{
InitializeComponent();
-
- /* for (int i = 1; i <= maxStars; i++)
- {
- var star = new Image
- {
- Source = "empty_star.svg", // image d'une étoile vide
- WidthRequest = 25,
- HeightRequest = 25
- };
-
- int currentStar = i;
-
- star.GestureRecognizers.Add(
- new TapGestureRecognizer { Command = new Command(() => StarTapped(currentStar)), }
- );
- StarLayout.Children.Add(star);
- }
-
- UpdateStars();
- BookDetail = ItemBook;
- BindingContext = this;*/
- }
- /*
- private void StarTapped(int rating)
- {
- if (rating > maxStars)
- {
- System.Diagnostics.Debug.WriteLine("Erreur : rating trop élevé!");
- return;
- }
-
- currentRating = rating;
- UpdateStars();
- RatingLabel.Text = $"Note: {currentRating}/{maxStars}";
+ BindingContext = data;
}
-
- private void UpdateStars()
- {
- for (int i = 0; i < maxStars; i++)
- {
- var star = (Image)StarLayout.Children[i];
- if (i < currentRating)
- star.Source = "filled_star.svg"; // image d'une étoile remplie
- else
- star.Source = "empty_star.svg";
- }
- }
-
- async void BackButton(object sender, EventArgs args)
- {
- await Shell.Current.Navigation.PopAsync();
- }*/
}
diff --git a/Sources/BookApp/Pages/EmpruntsPrets.xaml b/Sources/BookApp/Pages/EmpruntsPrets.xaml
index 66669f8..028c1b7 100644
--- a/Sources/BookApp/Pages/EmpruntsPrets.xaml
+++ b/Sources/BookApp/Pages/EmpruntsPrets.xaml
@@ -1,9 +1,9 @@
+ xmlns:vm="clr-namespace:BookApp.ViewModel"
+ x:Class="BookApp.Pages.EmpruntsPrets">
@@ -19,7 +19,9 @@
Source="Chevron_left.svg"
HorizontalOptions="Start">
-
+
@@ -71,7 +73,7 @@
-
+
-
-
+
+