diff --git a/sources/PocketBook/AddBook.xaml b/sources/PocketBook/AddBook.xaml new file mode 100644 index 0000000..41c967a --- /dev/null +++ b/sources/PocketBook/AddBook.xaml @@ -0,0 +1,11 @@ + + + + + + + diff --git a/sources/PocketBook/AddBook.xaml.cs b/sources/PocketBook/AddBook.xaml.cs new file mode 100644 index 0000000..7bfdd8d --- /dev/null +++ b/sources/PocketBook/AddBook.xaml.cs @@ -0,0 +1,11 @@ +using CommunityToolkit.Maui.Views; + +namespace PocketBook; + +public partial class AddBook : Popup +{ + public AddBook() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/sources/PocketBook/BookChange.xaml b/sources/PocketBook/BookChange.xaml index b28fce5..aa7bd16 100644 --- a/sources/PocketBook/BookChange.xaml +++ b/sources/PocketBook/BookChange.xaml @@ -1,9 +1,14 @@ - - - diff --git a/sources/PocketBook/MauiProgram.cs b/sources/PocketBook/MauiProgram.cs index a47d533..0f34e9d 100644 --- a/sources/PocketBook/MauiProgram.cs +++ b/sources/PocketBook/MauiProgram.cs @@ -1,4 +1,5 @@ using Microsoft.Extensions.Logging; +using CommunityToolkit.Maui; namespace PocketBook; @@ -6,17 +7,18 @@ public static class MauiProgram { public static MauiApp CreateMauiApp() { - var builder = MauiApp.CreateBuilder(); - builder - .UseMauiApp() - .ConfigureFonts(fonts => - { - fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); - fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); - }); + var builder = MauiApp.CreateBuilder(); + builder + .UseMauiApp() + .UseMauiCommunityToolkit() + .ConfigureFonts(fonts => + { + fonts.AddFont("OpenSans-Regular.ttf", "OpenSansRegular"); + fonts.AddFont("OpenSans-Semibold.ttf", "OpenSansSemibold"); + }); #if DEBUG - builder.Logging.AddDebug(); + builder.Logging.AddDebug(); #endif return builder.Build(); diff --git a/sources/PocketBook/PocketBook.csproj b/sources/PocketBook/PocketBook.csproj index 37befb6..890ca5e 100644 --- a/sources/PocketBook/PocketBook.csproj +++ b/sources/PocketBook/PocketBook.csproj @@ -49,10 +49,14 @@ + + + MSBuild:Compile + MSBuild:Compile diff --git a/sources/PocketBook/Resources/Images/barcode.svg b/sources/PocketBook/Resources/Images/barcode.svg new file mode 100644 index 0000000..72dc51b --- /dev/null +++ b/sources/PocketBook/Resources/Images/barcode.svg @@ -0,0 +1,7 @@ + + + + + Svg Vector Icons : http://www.onlinewebfonts.com/icon + + \ No newline at end of file diff --git a/sources/PocketBook/Resources/Images/barcode_scan.png b/sources/PocketBook/Resources/Images/barcode_scan.png new file mode 100644 index 0000000..a181ec5 Binary files /dev/null and b/sources/PocketBook/Resources/Images/barcode_scan.png differ diff --git a/sources/PocketBook/Resources/Images/keyboard.svg b/sources/PocketBook/Resources/Images/keyboard.svg new file mode 100644 index 0000000..91b87f3 --- /dev/null +++ b/sources/PocketBook/Resources/Images/keyboard.svg @@ -0,0 +1,7 @@ + + + + + Svg Vector Icons : http://www.onlinewebfonts.com/icon + + \ No newline at end of file diff --git a/sources/PocketBook/TousPage.xaml b/sources/PocketBook/TousPage.xaml index ac34fd5..b5266c4 100644 --- a/sources/PocketBook/TousPage.xaml +++ b/sources/PocketBook/TousPage.xaml @@ -2,16 +2,25 @@ + x:Class="PocketBook.TousPage" + xmlns:toolkit="http://schemas.microsoft.com/dotnet/2022/maui/toolkit"> - + + + + + @@ -20,7 +29,6 @@ - @@ -47,6 +55,27 @@ + + + + + + + + + + + + diff --git a/sources/PocketBook/TousPage.xaml.cs b/sources/PocketBook/TousPage.xaml.cs index 3a6d312..27d0cbf 100644 --- a/sources/PocketBook/TousPage.xaml.cs +++ b/sources/PocketBook/TousPage.xaml.cs @@ -1,60 +1,68 @@ -namespace PocketBook; - -public partial class Book -{ - public string name { get; set; } - public string type { get; set; } - public string auteur { get; set; } - public string image { get; set; } - - public Book(string name, string type,string auteur) - { - this.name = name; - this.auteur = auteur; - this.type = type; - } -} - -public partial class Auteur -{ - public string name { get; set; } - public List books { get; set; } - - public Auteur(string name) - { - this.name = name; - books = new List - { - new Book("Buveur d'encre", "En lecture", name), - new Book("Harry Potter et la pierre philosophale", "Non lu",name), - new Book("Le Seigneur des anneaux", "En lecture", name), - new Book("1984", "Terminé", name), - new Book("Le Petit Prince", "Non lu", name) - }; - } -} - -public partial class TousPage : ContentPage -{ - public List mesAuteurs { get; set; } - public List books { get; set; } - - public TousPage() - { - mesAuteurs = new List - { - new Auteur("J.K. Rowling"), - new Auteur("J.R.R. Tolkien") - }; - InitializeComponent(); - BindingContext=this; - } - public async void OnCollectionViewSelectionChanged(object sender, SelectionChangedEventArgs e) - { - if (e.CurrentSelection.FirstOrDefault() is Book livreSelectionne) - { - await Navigation.PushAsync(new BookDetail(livreSelectionne)); - } - } - +using CommunityToolkit.Maui.Views; + +namespace PocketBook; + +public partial class Book +{ + public string name { get; set; } + public string type { get; set; } + public string auteur { get; set; } + public string image { get; set; } + + public Book(string name, string type,string auteur) + { + this.name = name; + this.auteur = auteur; + this.type = type; + } +} + +public partial class Auteur +{ + public string name { get; set; } + public List books { get; set; } + + public Auteur(string name) + { + this.name = name; + books = new List + { + new Book("Buveur d'encre", "En lecture", name), + new Book("Harry Potter et la pierre philosophale", "Non lu",name), + new Book("Le Seigneur des anneaux", "En lecture", name), + new Book("1984", "Terminé", name), + new Book("Le Petit Prince", "Non lu", name) + }; + } +} + +public partial class TousPage : ContentPage +{ + public List mesAuteurs { get; set; } + public List books { get; set; } + + public bool clicked=false; + + public TousPage() + { + mesAuteurs = new List + { + new Auteur("J.K. Rowling"), + new Auteur("J.R.R. Tolkien") + }; + InitializeComponent(); + BindingContext=this; + } + public async void OnCollectionViewSelectionChanged(object sender, SelectionChangedEventArgs e) + { + if (e.CurrentSelection.FirstOrDefault() is Book livreSelectionne) + { + await Navigation.PushAsync(new BookDetail(livreSelectionne)); + } + } + + private void OnImageButtonClicked(object sender, EventArgs e) + { + var popup = new AddBook(); + } } \ No newline at end of file