From acae7d1ff0f6285fb150483f6da456a2b670644b Mon Sep 17 00:00:00 2001 From: Louis DUFOUR Date: Mon, 11 Sep 2023 23:54:02 +0200 Subject: [PATCH] Add (Front-End): Ajout de la 2e page & un peu de structure --- src/BookApp/AppShell.xaml | 5 +- src/BookApp/BookApp.csproj | 13 ++- src/BookApp/Composants/RatingView.xaml | 27 +++++ src/BookApp/Composants/RatingView.xaml.cs | 22 ++++ .../ContentView/ContentCollection.xaml | 37 ------- .../ContentView/ContentCollection.xaml.cs | 24 ---- src/BookApp/Data/Stub.cs | 66 +++++++++++ src/BookApp/MainPage.xaml | 2 +- src/BookApp/MainPage.xaml.cs | 3 - src/BookApp/MauiProgram.cs | 2 + src/BookApp/Model/Book.cs | 18 +++ src/BookApp/Model/Star.cs | 26 +++++ src/BookApp/Pages/DetailBook.xaml | 14 +++ src/BookApp/Pages/DetailBook.xaml.cs | 67 +++++++++++ src/BookApp/Pages/Tous.xaml | 104 +++++++++++++++--- src/BookApp/Pages/Tous.xaml.cs | 11 +- src/BookApp/Resources/Images/chevron_left.svg | 1 + src/BookApp/Resources/Images/empty_star.svg | 1 + src/BookApp/Resources/Images/filled_star.svg | 1 + .../UseCase/RatingToStarImageConverter.cs | 26 +++++ src/BookApp/ViewModel/TousViewModel.cs | 18 +++ src/TestFrontEnd/TestFrontEnd.csproj | 13 ++- symbols/icons8-sorting-arrows-64.png | Bin 0 -> 454 bytes 23 files changed, 406 insertions(+), 95 deletions(-) create mode 100644 src/BookApp/Composants/RatingView.xaml create mode 100644 src/BookApp/Composants/RatingView.xaml.cs delete mode 100644 src/BookApp/ContentView/ContentCollection.xaml delete mode 100644 src/BookApp/ContentView/ContentCollection.xaml.cs create mode 100644 src/BookApp/Data/Stub.cs create mode 100644 src/BookApp/Model/Book.cs create mode 100644 src/BookApp/Model/Star.cs create mode 100644 src/BookApp/Pages/DetailBook.xaml create mode 100644 src/BookApp/Pages/DetailBook.xaml.cs create mode 100644 src/BookApp/Resources/Images/chevron_left.svg create mode 100644 src/BookApp/Resources/Images/empty_star.svg create mode 100644 src/BookApp/Resources/Images/filled_star.svg create mode 100644 src/BookApp/UseCase/RatingToStarImageConverter.cs create mode 100644 src/BookApp/ViewModel/TousViewModel.cs create mode 100644 symbols/icons8-sorting-arrows-64.png diff --git a/src/BookApp/AppShell.xaml b/src/BookApp/AppShell.xaml index 9b032c7..fb3d58b 100644 --- a/src/BookApp/AppShell.xaml +++ b/src/BookApp/AppShell.xaml @@ -5,7 +5,10 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:local="clr-namespace:BookApp" Shell.FlyoutBehavior="Disabled"> + + + @@ -19,7 +22,7 @@ - + diff --git a/src/BookApp/BookApp.csproj b/src/BookApp/BookApp.csproj index 4b3f268..1454c6a 100644 --- a/src/BookApp/BookApp.csproj +++ b/src/BookApp/BookApp.csproj @@ -68,16 +68,23 @@ + - - ContentCollection.xaml + + RatingView.xaml + + + DetailBook.xaml - + + MSBuild:Compile + + MSBuild:Compile diff --git a/src/BookApp/Composants/RatingView.xaml b/src/BookApp/Composants/RatingView.xaml new file mode 100644 index 0000000..29395d3 --- /dev/null +++ b/src/BookApp/Composants/RatingView.xaml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/BookApp/Composants/RatingView.xaml.cs b/src/BookApp/Composants/RatingView.xaml.cs new file mode 100644 index 0000000..1beddf5 --- /dev/null +++ b/src/BookApp/Composants/RatingView.xaml.cs @@ -0,0 +1,22 @@ +using BookApp.Model; + +namespace BookApp.Composants; + +public partial class RatingView : ContentView +{ + public static readonly BindableProperty RatingProperty = + BindableProperty.Create(nameof(Rating), typeof(Star), typeof(RatingView), default(Star), BindingMode.TwoWay); + + public Star Rating + { + get { return (Star)GetValue(RatingProperty); } + set { SetValue(RatingProperty, value); } + } + + + public RatingView() + { + InitializeComponent(); + this.BindingContext = this; + } +} diff --git a/src/BookApp/ContentView/ContentCollection.xaml b/src/BookApp/ContentView/ContentCollection.xaml deleted file mode 100644 index 17569dd..0000000 --- a/src/BookApp/ContentView/ContentCollection.xaml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - -