diff --git a/Documentation/Schémas/Diagramme de class.drawio b/Documentation/Schémas/Diagramme de class.drawio
new file mode 100644
index 0000000..2b0142f
--- /dev/null
+++ b/Documentation/Schémas/Diagramme de class.drawio
@@ -0,0 +1,80 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/README.md b/README.md
index d31c403..f6784dd 100644
--- a/README.md
+++ b/README.md
@@ -1,29 +1,191 @@
-# PocketBook
-
-# TP1 : Pages & Views
-_à terminer pour le 17 septembre 2023 - 23h59_
-
-L'objectif est de reproduire les pages et les vues d'une application _PocketBook_ de recherche et de stockage de livres pour iPhone et Android en MAUI.
-Une reproduction la plus _parfaite_ possible est souhaitée (avec la _TabBar_, le bouton _Modifier_, etc.).
-
-Je vous conseille de faire (par ordre de priorité) :
-- la page d'accueil de la bibliothèque ("Mes livres" avec les menus),
-- la page affichant les livres,
-- la page affichant les détails d'un livre,
-- la page permettant de lister les auteurs et de filtrer les livres par auteur
-- le menu contextuel permettant d'ajouter un nouveau livre
-- une page permettant de prêter ou d'emprunter à livre à quelqu'un
-- la page permettant de lister les années de publication et de filtrer les livres
-- la page permettant de trier les livres par note.
-
-## Critères d'évaluation
-- L'app doit marcher sur iOS et Android
-- Création des pages
-- Utilisation de _Views_ (layout, affichage, buttons...)
-- Création de _Views_ personnalisées
-- Création et utilisation de Styles et ressources
-- Création et utilisation des _Themes_ (light & dark)
-- (si besoin) utilisation du MAUI Community Toolkit
+# PocketBook - Louis DUFOUR
+
+## Informations projet
+Application développer sous android API 28 pour ma part.
+
+### Documentation
+Vous avez des débuts de schéma, mais cela reste encore en cour de construction.
+
+### Cas d'erreur connus
+#### Vu principale
+- Button + *(TODO)*
+- Button modifier *(TODO)*
+
+#### Vu Tous
+- Nom auteur problème d'affichage *(TODO)*
+- Image par défaut *(TODO prévoire une image pardéfaut)*
+- Button Tri *(TODO)*
+- Button + *(TODO)*
+
+#### Vu Detail
+- Binding data *(En cours)*
+- Button:
+ - Déplacer Livre *(TODO)*
+ - Ajouter à la liste à lire plustard *(TODO)*
+ - Changer le status *(TODO)*
+ - préter le livre *(TODO)*
+
+#### Vu Emprunt
+- Page xaml *(TODO)*
+- logic du switch button *(TODO)*
+- Button tri *(TODO)*
+- Button + *(TODO)*
+
+#### Vu Filtre
+- Button Tri (avec le changement du nom en haut)
+- Barre de recherche
+(utiliser l'appel par nom d'auteur)
+- Binding du nombre de livre
+
+### L'accès au code noté
+- Projet ToolKitt
+- Projet VMWrapper
+- Projet BookApp Dossier ViewModel
+
+## Modèle
+
+```mermaid
+classDiagram
+direction LR
+class Book {
+ +Id : string
+ +Title : string
+ +Publishers : List~string~
+ +PublishDate : DateTime
+ +ISBN13 : string
+ +Series : List~string~
+ +NbPages : int
+ +Format : string
+ +ImageSmall : string
+ +ImageMedium : string
+ +ImageLarge : string
+}
+
+class Languages {
+ <>
+ Unknown,
+ French,
+}
+
+class Work {
+ +Id : string
+ +Description : string
+ +Title : string
+ +Subjects : List~string~
+}
+
+class Contributor {
+ +Name : string
+ +Role : string
+}
+
+class Author {
+ +Id : string
+ +Name : string
+ +ImageSmall : string
+ +ImageMedium : string
+ +ImageLarge : string
+ +Bio : string
+ +AlternateNames : List~string~
+ +BirthDate : DateTime?
+ +DeathDate : DateTime?
+}
+
+class Link {
+ +Title : string
+ +Url : string
+}
+
+class Ratings {
+ +Average : float
+ +Count : int
+}
+
+Book --> "1" Languages : Language
+Book --> "*" Contributor : Contributors
+Author --> "*" Link : Links
+Work --> "*" Author : Authors
+Work --> "1" Ratings : Ratings
+Book --> "*" Author : Authors
+Book --> "*" Work : Works
+
+class Status {
+ <>
+ Unknown,
+ Finished,
+ Reading,
+ NotRead,
+ ToBeRead
+}
+
+class Contact{
+ +string Id;
+ +string FirstName;
+ +string LastName;
+}
+```
+
+## Services & Interfaces
+```mermaid
+classDiagram
+direction LR
+Book --> "1" Languages : Language
+Book --> "*" Contributor : Contributors
+Author --> "*" Link : Links
+Work --> "1" Ratings : Ratings
+Work --> "*" Author : Authors
+Book --> "*" Work : Works
+Book --> "*" Author : Authors
+
+class IUserLibraryManager {
+ <>
+ +AddBook(Book book) : Task
+ +AddBook(string id) : Task
+ +AddBookByIsbn(string isbn) : Task
+ +RemoveBook(Book book) : Task
+ +RemoveBook(string id) : Task
+ +RemoveBook(string id) : Task
+ +AddToFavorites(Book book) : Task
+ +AddToFavorites(string bookId) : Task
+ +RemoveFromFavorites(Book book) : Task
+ +RemoveFromFavorites(string bookId) : Task
+ +UpdateBook(Book updatedBook) : Task
+ +AddContact(Contact contact) : Task
+ +RemoveContact(Contact contact) : Task
+ +LendBook(Book book, Contact contact, DateTime? loanDate) : Task
+ +GetBackBook(Book book, DateTime? returnedDate) : Task
+ +BorrowBook(Book book, Contact owner, DateTime? borrowedDate) : Task
+ +GiveBackBook(Book book, DateTime? returnedDate) : Task
+
+ +GetCurrentLoans(int index, int count)
+ +GetPastLoans(int index, int count)
+ +GetCurrentBorrowings(int index, int count)
+ +GetPastBorrowings(int index, int count)
+ +GetContacts(int index, int count)
+}
+
+class ILibraryManager {
+ <>
+ +GetBookById(string id)
+ +GetBookByIsbn(string isbn)
+ +GetBooksByTitle(string title, int index, int count, string sort)
+ +GetBooksByAuthorId(string authorId, int index, int count, string sort)
+ +GetBooksByAuthor(string author, int index, int count, string sort)
+ +GetAuthorById(string id)
+ +GetAuthorsByName(string substring, int index, int count, string sort)
+}
+
+class Status {
+ <>
+}
+
+IUserLibraryManager ..|> ILibraryManager
+IUserLibraryManager ..> Status
+IUserLibraryManager ..> Contact
+IUserLibraryManager ..> Book
+ILibraryManager ..> Book
+ILibraryManager ..> Author
+```
## Ressources
- [Doc officielle MAUI](https://learn.microsoft.com/en-us/dotnet/maui/)
@@ -71,6 +233,11 @@ Lorsqu'on clique sur un le filtre "Date de publication" de la page "Mes Livres",
Un clic sur une de ces années permet d'aller sur la même page que celle qui affiche la liste des livres, mais seuls les livres publiée cette année apparaitront.
+### Emprunts / Prêts
+Lorsqu'on clique sur le menu "En prêt" sur la page d'accueil, on peut voir la liste de nos emprunts et de nos prêts répartis par contacts. Par exemple :
+
+Le switch permet de voir les livres qu'on a prêtés regroupés par contacts, ou les livres qu'on a empruntés regroupés par prêteurs.
+
### Le fameux bouton "+"
Un clic sur le bouton "+" fait apparaître un sous-menu permettant d'ajouter un livre à la bibliothèque :
- en scannant un code-barres (cf. plus bas)
@@ -85,11 +252,3 @@ La page Scan pourra être réalisée plus tard.
-# Troubleshootings
-
-#### J'ai bien renommé mes images, mais le Mac continue à me dire que non...
-C'est peut-être dû au fait que certains fichiers cachés n'ont pas été correctement exclus (notamment les ```.DS_Store```).
-Essayez d'appeler cette commande depuis un Terminal (sous Visual ou depuis... un Terminal) :
-```
-find . -name ".DS_Store" -delete
-```
diff --git a/Sources/BookApp.sln b/Sources/BookApp.sln
index 564ec79..24acfb1 100644
--- a/Sources/BookApp.sln
+++ b/Sources/BookApp.sln
@@ -1,33 +1,87 @@
-
-Microsoft Visual Studio Solution File, Format Version 12.00
-# Visual Studio Version 17
-VisualStudioVersion = 17.7.34024.191
-MinimumVisualStudioVersion = 10.0.40219.1
-Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookApp", "BookApp\BookApp.csproj", "{DBD6BB08-83E2-42EA-A28C-32DB6959E4B5}"
-EndProject
-Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TestFrontEnd", "TestFrontEnd\TestFrontEnd.csproj", "{90EE7351-A889-4CE3-B066-090931FD69C6}"
-EndProject
-Global
- GlobalSection(SolutionConfigurationPlatforms) = preSolution
- Debug|Any CPU = Debug|Any CPU
- Release|Any CPU = Release|Any CPU
- EndGlobalSection
- GlobalSection(ProjectConfigurationPlatforms) = postSolution
- {DBD6BB08-83E2-42EA-A28C-32DB6959E4B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {DBD6BB08-83E2-42EA-A28C-32DB6959E4B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {DBD6BB08-83E2-42EA-A28C-32DB6959E4B5}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
- {DBD6BB08-83E2-42EA-A28C-32DB6959E4B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {DBD6BB08-83E2-42EA-A28C-32DB6959E4B5}.Release|Any CPU.Build.0 = Release|Any CPU
- {DBD6BB08-83E2-42EA-A28C-32DB6959E4B5}.Release|Any CPU.Deploy.0 = Release|Any CPU
- {90EE7351-A889-4CE3-B066-090931FD69C6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
- {90EE7351-A889-4CE3-B066-090931FD69C6}.Debug|Any CPU.Build.0 = Debug|Any CPU
- {90EE7351-A889-4CE3-B066-090931FD69C6}.Release|Any CPU.ActiveCfg = Release|Any CPU
- {90EE7351-A889-4CE3-B066-090931FD69C6}.Release|Any CPU.Build.0 = Release|Any CPU
- EndGlobalSection
- GlobalSection(SolutionProperties) = preSolution
- HideSolutionNode = FALSE
- EndGlobalSection
- GlobalSection(ExtensibilityGlobals) = postSolution
- SolutionGuid = {27FCF0C7-3613-4FC6-9E95-2EEFB171F0F4}
- EndGlobalSection
-EndGlobal
+
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio Version 17
+VisualStudioVersion = 17.7.34024.191
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "BookApp", "BookApp\BookApp.csproj", "{DBD6BB08-83E2-42EA-A28C-32DB6959E4B5}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DtoAbstractLayer", "DtoAbstractLayer\DtoAbstractLayer.csproj", "{C45DF3F7-AFCA-4252-89CC-1A6E5CA9EF33}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "JsonReader", "JsonReader\JsonReader.csproj", "{F2A0B67A-2BA9-4447-9BFD-708D430EBCFA}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "LibraryDTO", "LibraryDTO\LibraryDTO.csproj", "{94F9B003-9A66-424E-9758-77D140F041BA}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Model", "Model\Model.csproj", "{70ECEB25-24E4-47AA-BA64-0F0C8C4F090F}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "StubbedDTO", "StubbedDTO\StubbedDTO.csproj", "{B84474A1-D290-473B-AFF3-FA4ECB509024}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Utils", "Utils\Utils.csproj", "{03A3193F-92CC-4360-8061-E5207CC7FD2F}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Stub", "Stub\Stub.csproj", "{14ED7ADF-7B83-432E-A87B-40C153041067}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Tests", "Tests\Tests.csproj", "{945A6DB3-CB0A-4FB8-8117-64F0CB0D838A}"
+EndProject
+Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "VMWrapper", "VMWrapper\VMWrapper.csproj", "{377DC5AB-5D7C-4A29-ACED-C08B581A8E58}"
+EndProject
+Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "ToolKit", "ToolKit\ToolKit.csproj", "{778541B9-BECF-49DC-8860-B8F134A6F4E2}"
+EndProject
+Global
+ GlobalSection(SolutionConfigurationPlatforms) = preSolution
+ Debug|Any CPU = Debug|Any CPU
+ Release|Any CPU = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(ProjectConfigurationPlatforms) = postSolution
+ {DBD6BB08-83E2-42EA-A28C-32DB6959E4B5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {DBD6BB08-83E2-42EA-A28C-32DB6959E4B5}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {DBD6BB08-83E2-42EA-A28C-32DB6959E4B5}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
+ {DBD6BB08-83E2-42EA-A28C-32DB6959E4B5}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {DBD6BB08-83E2-42EA-A28C-32DB6959E4B5}.Release|Any CPU.Build.0 = Release|Any CPU
+ {DBD6BB08-83E2-42EA-A28C-32DB6959E4B5}.Release|Any CPU.Deploy.0 = Release|Any CPU
+ {C45DF3F7-AFCA-4252-89CC-1A6E5CA9EF33}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {C45DF3F7-AFCA-4252-89CC-1A6E5CA9EF33}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {C45DF3F7-AFCA-4252-89CC-1A6E5CA9EF33}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {C45DF3F7-AFCA-4252-89CC-1A6E5CA9EF33}.Release|Any CPU.Build.0 = Release|Any CPU
+ {F2A0B67A-2BA9-4447-9BFD-708D430EBCFA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {F2A0B67A-2BA9-4447-9BFD-708D430EBCFA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {F2A0B67A-2BA9-4447-9BFD-708D430EBCFA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {F2A0B67A-2BA9-4447-9BFD-708D430EBCFA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {94F9B003-9A66-424E-9758-77D140F041BA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {94F9B003-9A66-424E-9758-77D140F041BA}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {94F9B003-9A66-424E-9758-77D140F041BA}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {94F9B003-9A66-424E-9758-77D140F041BA}.Release|Any CPU.Build.0 = Release|Any CPU
+ {70ECEB25-24E4-47AA-BA64-0F0C8C4F090F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {70ECEB25-24E4-47AA-BA64-0F0C8C4F090F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {70ECEB25-24E4-47AA-BA64-0F0C8C4F090F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {70ECEB25-24E4-47AA-BA64-0F0C8C4F090F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {B84474A1-D290-473B-AFF3-FA4ECB509024}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {B84474A1-D290-473B-AFF3-FA4ECB509024}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {B84474A1-D290-473B-AFF3-FA4ECB509024}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {B84474A1-D290-473B-AFF3-FA4ECB509024}.Release|Any CPU.Build.0 = Release|Any CPU
+ {03A3193F-92CC-4360-8061-E5207CC7FD2F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {03A3193F-92CC-4360-8061-E5207CC7FD2F}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {03A3193F-92CC-4360-8061-E5207CC7FD2F}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {03A3193F-92CC-4360-8061-E5207CC7FD2F}.Release|Any CPU.Build.0 = Release|Any CPU
+ {14ED7ADF-7B83-432E-A87B-40C153041067}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {14ED7ADF-7B83-432E-A87B-40C153041067}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {14ED7ADF-7B83-432E-A87B-40C153041067}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {14ED7ADF-7B83-432E-A87B-40C153041067}.Release|Any CPU.Build.0 = Release|Any CPU
+ {945A6DB3-CB0A-4FB8-8117-64F0CB0D838A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {945A6DB3-CB0A-4FB8-8117-64F0CB0D838A}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {945A6DB3-CB0A-4FB8-8117-64F0CB0D838A}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {945A6DB3-CB0A-4FB8-8117-64F0CB0D838A}.Release|Any CPU.Build.0 = Release|Any CPU
+ {377DC5AB-5D7C-4A29-ACED-C08B581A8E58}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {377DC5AB-5D7C-4A29-ACED-C08B581A8E58}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {377DC5AB-5D7C-4A29-ACED-C08B581A8E58}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {377DC5AB-5D7C-4A29-ACED-C08B581A8E58}.Release|Any CPU.Build.0 = Release|Any CPU
+ {778541B9-BECF-49DC-8860-B8F134A6F4E2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
+ {778541B9-BECF-49DC-8860-B8F134A6F4E2}.Debug|Any CPU.Build.0 = Debug|Any CPU
+ {778541B9-BECF-49DC-8860-B8F134A6F4E2}.Release|Any CPU.ActiveCfg = Release|Any CPU
+ {778541B9-BECF-49DC-8860-B8F134A6F4E2}.Release|Any CPU.Build.0 = Release|Any CPU
+ EndGlobalSection
+ GlobalSection(SolutionProperties) = preSolution
+ HideSolutionNode = FALSE
+ EndGlobalSection
+ GlobalSection(ExtensibilityGlobals) = postSolution
+ SolutionGuid = {27FCF0C7-3613-4FC6-9E95-2EEFB171F0F4}
+ EndGlobalSection
+EndGlobal
diff --git a/Sources/BookApp/AppShell.xaml b/Sources/BookApp/AppShell.xaml
index 17d3960..8d1f046 100644
--- a/Sources/BookApp/AppShell.xaml
+++ b/Sources/BookApp/AppShell.xaml
@@ -10,24 +10,21 @@
+ Icon="books_vertical_fill.svg">
-
+ Icon="list_bullet.svg">
+
-
+ Icon="bookmark_fill.svg">
+
-
+ Icon="magnifyingglass.svg">
+
-
-
-
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/BookApp.csproj b/Sources/BookApp/BookApp.csproj
index 9fa3b51..0eae26e 100644
--- a/Sources/BookApp/BookApp.csproj
+++ b/Sources/BookApp/BookApp.csproj
@@ -67,9 +67,17 @@
-
+
+
+
+
+
+
+
+
+
@@ -79,6 +87,9 @@
MSBuild:Compile
+
+ MSBuild:Compile
+
MSBuild:Compile
diff --git a/Sources/BookApp/Composants/CollectionFiltrage.xaml b/Sources/BookApp/Composants/CollectionFiltrage.xaml
index 0488b1a..79a5eab 100644
--- a/Sources/BookApp/Composants/CollectionFiltrage.xaml
+++ b/Sources/BookApp/Composants/CollectionFiltrage.xaml
@@ -2,10 +2,12 @@
-
+
-
+
@@ -19,8 +21,8 @@
-
-
+
+
+
+
+
+
+
+
+
@@ -54,9 +66,9 @@
-
+
-
+
@@ -81,13 +93,13 @@
-
+
-
+
-
+
@@ -101,11 +113,11 @@
-
+
-
+
-
+
@@ -115,7 +127,7 @@
-
+
@@ -125,7 +137,7 @@
-
+
@@ -163,6 +175,9 @@
+
+
+
diff --git a/Sources/BookApp/Pages/DetailBook.xaml.cs b/Sources/BookApp/Pages/DetailBook.xaml.cs
index c11094d..255c033 100644
--- a/Sources/BookApp/Pages/DetailBook.xaml.cs
+++ b/Sources/BookApp/Pages/DetailBook.xaml.cs
@@ -1,68 +1,16 @@
-using BookApp.Model;
-using System.Collections.ObjectModel;
+using BookApp.ViewModel;
+using System.Diagnostics;
-namespace BookApp.Pages;
-
-public partial class DetailBook : ContentPage
+namespace BookApp.Pages
{
- private int maxStars = 5;
- private int currentRating = 0;
-
- public Book BookDetail { get; set; }
-
- public DetailBook(Book ItemBook)
- {
- 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)
+ public partial class DetailBook : ContentPage
{
- if (rating > maxStars)
- {
- System.Diagnostics.Debug.WriteLine("Erreur : rating trop élevé!");
- return;
- }
-
- currentRating = rating;
- UpdateStars();
- RatingLabel.Text = $"Note: {currentRating}/{maxStars}";
- }
+ public ViewModelNavigation Nav { get; } = new ViewModelNavigation();
- private void UpdateStars()
- {
- for (int i = 0; i < maxStars; i++)
+ public DetailBook(ViewModelDetailProvider VMProvider)
{
- 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";
+ InitializeComponent();
+ BindingContext = VMProvider;
}
}
-
- 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..8af46e3 100644
--- a/Sources/BookApp/Pages/EmpruntsPrets.xaml
+++ b/Sources/BookApp/Pages/EmpruntsPrets.xaml
@@ -1,9 +1,10 @@
+ xmlns:composants="clr-namespace:BookApp.Composants"
+ x:Name="ThisPage"
+ x:Class="BookApp.Pages.EmpruntsPrets">
@@ -19,7 +20,8 @@
Source="Chevron_left.svg"
HorizontalOptions="Start">
-
+
@@ -68,33 +70,17 @@
-
-
-
-
-
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
\ No newline at end of file
diff --git a/Sources/BookApp/Pages/EmpruntsPrets.xaml.cs b/Sources/BookApp/Pages/EmpruntsPrets.xaml.cs
index eae3847..6bf348b 100644
--- a/Sources/BookApp/Pages/EmpruntsPrets.xaml.cs
+++ b/Sources/BookApp/Pages/EmpruntsPrets.xaml.cs
@@ -1,35 +1,17 @@
+using BookApp.ViewModel;
using System.Windows.Input;
+using VMWrapper;
-namespace BookApp.Pages;
-
-public partial class EmpruntsPrets : ContentPage
+namespace BookApp.Pages
{
- public ICommand TapCommand => new Command(ToggleSwitch);
-
- private bool _isToggled;
-
- public bool IsToggled
+ public partial class EmpruntsPrets : ContentPage
{
- get => _isToggled;
- set
+ public ViewModelNavigation Nav { get; } = new ViewModelNavigation();
+
+ public EmpruntsPrets(BooksViewModel data)
{
- _isToggled = value;
- OnPropertyChanged();
+ InitializeComponent();
+ BindingContext = data;
}
}
-
- public EmpruntsPrets()
- {
- InitializeComponent();
- }
-
- async void BackButton(object sender, EventArgs args)
- {
- await Shell.Current.Navigation.PopAsync();
- }
-
- private void ToggleSwitch()
- {
- IsToggled = !IsToggled;
- }
}
diff --git a/Sources/BookApp/Pages/Filtrage.xaml b/Sources/BookApp/Pages/Filtrage.xaml
index de42150..1b6177b 100644
--- a/Sources/BookApp/Pages/Filtrage.xaml
+++ b/Sources/BookApp/Pages/Filtrage.xaml
@@ -4,6 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"
xmlns:composants="clr-namespace:BookApp.Composants"
+ x:Name="ThisPage"
x:Class="BookApp.Pages.Filtrage">
@@ -20,25 +21,17 @@
Source="Chevron_left.svg"
HorizontalOptions="Start">
-
+
-
-