From aab6b54ecd2a773b9be5b88e8ec473962f7974f9 Mon Sep 17 00:00:00 2001 From: lobroda Date: Sat, 16 Sep 2023 18:09:17 +0100 Subject: [PATCH] ADD : Navigation & Last Views --- LivreLand/LivreLand.csproj | 9 + LivreLand/View/ALirePlusTardView.xaml | 120 ++++++++++ LivreLand/View/ALirePlusTardView.xaml.cs | 22 ++ LivreLand/View/BibliothequeView.xaml | 25 ++- LivreLand/View/BibliothequeView.xaml.cs | 62 +++++- .../View/ContentViews/HomeButtonView.xaml | 3 + .../View/ContentViews/HomeButtonView.xaml.cs | 8 + LivreLand/View/EmpruntsPretsView.xaml | 2 +- LivreLand/View/FavorisView.xaml | 120 ++++++++++ LivreLand/View/FavorisView.xaml.cs | 23 ++ LivreLand/View/FiltrageNoteView.xaml | 20 +- LivreLand/View/StatutLectureView.xaml | 205 ++++++++++++++++++ LivreLand/View/StatutLectureView.xaml.cs | 30 +++ 13 files changed, 628 insertions(+), 21 deletions(-) create mode 100644 LivreLand/View/ALirePlusTardView.xaml create mode 100644 LivreLand/View/ALirePlusTardView.xaml.cs create mode 100644 LivreLand/View/FavorisView.xaml create mode 100644 LivreLand/View/FavorisView.xaml.cs create mode 100644 LivreLand/View/StatutLectureView.xaml create mode 100644 LivreLand/View/StatutLectureView.xaml.cs diff --git a/LivreLand/LivreLand.csproj b/LivreLand/LivreLand.csproj index bd17d71..e6c03fc 100644 --- a/LivreLand/LivreLand.csproj +++ b/LivreLand/LivreLand.csproj @@ -58,6 +58,9 @@ + + MSBuild:Compile + MSBuild:Compile @@ -103,6 +106,9 @@ MSBuild:Compile + + MSBuild:Compile + MSBuild:Compile @@ -118,6 +124,9 @@ MSBuild:Compile + + MSBuild:Compile + MSBuild:Compile diff --git a/LivreLand/View/ALirePlusTardView.xaml b/LivreLand/View/ALirePlusTardView.xaml new file mode 100644 index 0000000..8038238 --- /dev/null +++ b/LivreLand/View/ALirePlusTardView.xaml @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LivreLand/View/ALirePlusTardView.xaml.cs b/LivreLand/View/ALirePlusTardView.xaml.cs new file mode 100644 index 0000000..0b16014 --- /dev/null +++ b/LivreLand/View/ALirePlusTardView.xaml.cs @@ -0,0 +1,22 @@ +using LivreLand.Model; + +namespace LivreLand.View; + +public partial class ALirePlusTardView : ContentPage +{ + public List ALirePlusTardBooks { get; set; } = new List() + { + new BookModel("La horde du contrevent","Alain Damasio","Non lu", 0), + }; + + public ALirePlusTardView() + { + BindingContext = this; + InitializeComponent(); + } + + void OnSelectionChanged(object sender, SelectionChangedEventArgs e) + { + App.Current.MainPage.Navigation.PushAsync(new DetailsLivreView()); + } +} \ No newline at end of file diff --git a/LivreLand/View/BibliothequeView.xaml b/LivreLand/View/BibliothequeView.xaml index 53ec420..d95605a 100644 --- a/LivreLand/View/BibliothequeView.xaml +++ b/LivreLand/View/BibliothequeView.xaml @@ -7,6 +7,7 @@ x:Class="LivreLand.View.BibliothequeView" x:Name="this" Title="BibliothequeView"> + @@ -53,7 +54,8 @@ ButtonIcon="tray_2_fill.png" ButtonNumber="45" ButtonRedIconVisible="False" - ButtonBlackIconVisible="True"/> + ButtonBlackIconVisible="True" + ButtonTappedCommand="{Binding TousNavigationCommand}"/> @@ -62,7 +64,8 @@ ButtonIcon="person_badge_clock_fill.png" ButtonNumber="1" ButtonRedIconVisible="False" - ButtonBlackIconVisible="True"/> + ButtonBlackIconVisible="True" + ButtonTappedCommand="{Binding EmpruntsPretsNavigationCommand}"/> @@ -70,7 +73,8 @@ + ButtonBlackIconVisible="True" + ButtonTappedCommand="{Binding ALirePlusTardNavigationCommand}"/> @@ -78,7 +82,8 @@ + ButtonBlackIconVisible="True" + ButtonTappedCommand="{Binding StatutLectureNavigationCommand}"/> @@ -86,7 +91,8 @@ + ButtonBlackIconVisible="True" + ButtonTappedCommand="{Binding FavorisNavigationCommand}"/> @@ -107,7 +113,8 @@ + ButtonBlackIconVisible="True" + ButtonTappedCommand="{Binding AuteurNavigationCommand}"/> @@ -115,7 +122,8 @@ + ButtonBlackIconVisible="True" + ButtonTappedCommand="{Binding DatePublicationNavigationCommand}"/> @@ -123,7 +131,8 @@ + ButtonBlackIconVisible="True" + ButtonTappedCommand="{Binding NoteNavigationCommand}"/> diff --git a/LivreLand/View/BibliothequeView.xaml.cs b/LivreLand/View/BibliothequeView.xaml.cs index 17d8118..3ec6237 100644 --- a/LivreLand/View/BibliothequeView.xaml.cs +++ b/LivreLand/View/BibliothequeView.xaml.cs @@ -4,8 +4,66 @@ namespace LivreLand.View; public partial class BibliothequeView : ContentPage { - public BibliothequeView() + public ICommand TousNavigationCommand { get; } + public ICommand EmpruntsPretsNavigationCommand { get; } + public ICommand ALirePlusTardNavigationCommand { get; } + public ICommand StatutLectureNavigationCommand { get; } + public ICommand FavorisNavigationCommand { get; } + public ICommand AuteurNavigationCommand { get; } + public ICommand DatePublicationNavigationCommand { get; } + public ICommand NoteNavigationCommand { get; } + + public BibliothequeView() { - InitializeComponent(); + TousNavigationCommand = new Command(TousNavigation); + EmpruntsPretsNavigationCommand = new Command(EmpruntsPretsNavigation); + ALirePlusTardNavigationCommand = new Command(ALirePlusTardNavigation); + StatutLectureNavigationCommand = new Command(StatutLectureNavigation); + FavorisNavigationCommand = new Command(FavorisNavigation); + AuteurNavigationCommand = new Command(AuteurNavigation); + DatePublicationNavigationCommand = new Command(DatePublicationNavigation); + NoteNavigationCommand = new Command(NoteNavigation); + InitializeComponent(); + } + + //Gestion de la navigation temporaire + private async void TousNavigation() + { + await App.Current.MainPage.Navigation.PushAsync(new TousView()); + } + + private async void EmpruntsPretsNavigation() + { + await App.Current.MainPage.Navigation.PushAsync(new EmpruntsPretsView()); + } + + private async void ALirePlusTardNavigation() + { + await App.Current.MainPage.Navigation.PushAsync(new ALirePlusTardView()); + } + + private async void StatutLectureNavigation() + { + await App.Current.MainPage.Navigation.PushAsync(new StatutLectureView()); + } + + private async void AuteurNavigation() + { + await App.Current.MainPage.Navigation.PushAsync(new FiltrageAuteurView()); + } + + private async void FavorisNavigation() + { + await App.Current.MainPage.Navigation.PushAsync(new FavorisView()); + } + + private async void DatePublicationNavigation() + { + await App.Current.MainPage.Navigation.PushAsync(new FiltrageDateView()); + } + + private async void NoteNavigation() + { + await App.Current.MainPage.Navigation.PushAsync(new FiltrageNoteView()); } } \ No newline at end of file diff --git a/LivreLand/View/ContentViews/HomeButtonView.xaml b/LivreLand/View/ContentViews/HomeButtonView.xaml index e6db27f..245bfde 100644 --- a/LivreLand/View/ContentViews/HomeButtonView.xaml +++ b/LivreLand/View/ContentViews/HomeButtonView.xaml @@ -51,6 +51,9 @@ + + + diff --git a/LivreLand/View/ContentViews/HomeButtonView.xaml.cs b/LivreLand/View/ContentViews/HomeButtonView.xaml.cs index 4debe65..48d44da 100644 --- a/LivreLand/View/ContentViews/HomeButtonView.xaml.cs +++ b/LivreLand/View/ContentViews/HomeButtonView.xaml.cs @@ -1,4 +1,5 @@ using Microsoft.Maui.Graphics; +using System.Windows.Input; namespace LivreLand.View.ContentViews; @@ -39,6 +40,13 @@ public partial class HomeButtonView : ContentView set => SetValue(HomeButtonView.ButtonBlackIconVisibleProperty, value); } + public static readonly BindableProperty ButtonTappedCommandProperty = BindableProperty.Create(nameof(ButtonTappedCommand), typeof(ICommand), typeof(HomeButtonView)); + public ICommand ButtonTappedCommand + { + get { return (ICommand)GetValue(ButtonTappedCommandProperty); } + set { SetValue(ButtonTappedCommandProperty, value); } + } + public HomeButtonView() { InitializeComponent(); diff --git a/LivreLand/View/EmpruntsPretsView.xaml b/LivreLand/View/EmpruntsPretsView.xaml index 3b14861..ea32c73 100644 --- a/LivreLand/View/EmpruntsPretsView.xaml +++ b/LivreLand/View/EmpruntsPretsView.xaml @@ -15,7 +15,7 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LivreLand/View/FavorisView.xaml.cs b/LivreLand/View/FavorisView.xaml.cs new file mode 100644 index 0000000..b4e5a7a --- /dev/null +++ b/LivreLand/View/FavorisView.xaml.cs @@ -0,0 +1,23 @@ +using LivreLand.Model; + +namespace LivreLand.View; + +public partial class FavorisView : ContentPage +{ + public List FavorisBooks { get; set; } = new List() + { + new BookModel("La zone du dehors","Alain Damasio","Terminé", 0), + new BookModel("Le problème à trois corps","Cixin Liu","Terminé", 0) + }; + + public FavorisView() + { + BindingContext = this; + InitializeComponent(); + } + + void OnSelectionChanged(object sender, SelectionChangedEventArgs e) + { + App.Current.MainPage.Navigation.PushAsync(new DetailsLivreView()); + } +} \ No newline at end of file diff --git a/LivreLand/View/FiltrageNoteView.xaml b/LivreLand/View/FiltrageNoteView.xaml index 426657f..e8eb5ae 100644 --- a/LivreLand/View/FiltrageNoteView.xaml +++ b/LivreLand/View/FiltrageNoteView.xaml @@ -38,8 +38,8 @@ + ButtonRedIconVisible="True" + ButtonBlackIconVisible="False"/> @@ -47,8 +47,8 @@ + ButtonRedIconVisible="True" + ButtonBlackIconVisible="False"/> @@ -56,8 +56,8 @@ + ButtonRedIconVisible="True" + ButtonBlackIconVisible="False"/> @@ -65,8 +65,8 @@ + ButtonRedIconVisible="True" + ButtonBlackIconVisible="False"/> @@ -74,8 +74,8 @@ + ButtonRedIconVisible="True" + ButtonBlackIconVisible="False"/> diff --git a/LivreLand/View/StatutLectureView.xaml b/LivreLand/View/StatutLectureView.xaml new file mode 100644 index 0000000..8c65f33 --- /dev/null +++ b/LivreLand/View/StatutLectureView.xaml @@ -0,0 +1,205 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/LivreLand/View/StatutLectureView.xaml.cs b/LivreLand/View/StatutLectureView.xaml.cs new file mode 100644 index 0000000..9c9c276 --- /dev/null +++ b/LivreLand/View/StatutLectureView.xaml.cs @@ -0,0 +1,30 @@ +using LivreLand.Model; + +namespace LivreLand.View; + +public partial class StatutLectureView : ContentPage +{ + public List NonLuBooks { get; set; } = new List() + { + new BookModel("La horde du contrevent","Alain Damasio","Non lu", 0), + }; + + public List TermineBooks { get; set; } = new List() + { + new BookModel("La zone du dehors","Alain Damasio","Terminé", 0), + new BookModel("L'équateur d'Einstein","Cixin Liu","Terminé", 0), + new BookModel("La forêt sombre","Cixin Liu","Terminé", 0), + new BookModel("Le problème à trois corps","Cixin Liu","Terminé", 0) + }; + + public StatutLectureView() + { + BindingContext = this; + InitializeComponent(); + } + + void OnSelectionChanged(object sender, SelectionChangedEventArgs e) + { + App.Current.MainPage.Navigation.PushAsync(new DetailsLivreView()); + } +} \ No newline at end of file