diff --git a/MVVM/.vs/MVVM/DesignTimeBuild/.dtbcache.v2 b/MVVM/.vs/MVVM/DesignTimeBuild/.dtbcache.v2 index 192a63bf..e718d01e 100644 Binary files a/MVVM/.vs/MVVM/DesignTimeBuild/.dtbcache.v2 and b/MVVM/.vs/MVVM/DesignTimeBuild/.dtbcache.v2 differ diff --git a/MVVM/.vs/MVVM/FileContentIndex/0bdbb77c-b6e5-4f99-a5a0-cd19ad3c44e9.vsidx b/MVVM/.vs/MVVM/FileContentIndex/0bdbb77c-b6e5-4f99-a5a0-cd19ad3c44e9.vsidx new file mode 100644 index 00000000..b0bd62b0 Binary files /dev/null and b/MVVM/.vs/MVVM/FileContentIndex/0bdbb77c-b6e5-4f99-a5a0-cd19ad3c44e9.vsidx differ diff --git a/MVVM/.vs/MVVM/FileContentIndex/48301ce8-bfb7-4587-8064-fa983afe12d0.vsidx b/MVVM/.vs/MVVM/FileContentIndex/48301ce8-bfb7-4587-8064-fa983afe12d0.vsidx deleted file mode 100644 index 4193d399..00000000 Binary files a/MVVM/.vs/MVVM/FileContentIndex/48301ce8-bfb7-4587-8064-fa983afe12d0.vsidx and /dev/null differ diff --git a/MVVM/.vs/MVVM/v17/.futdcache.v2 b/MVVM/.vs/MVVM/v17/.futdcache.v2 index 034c406c..f5be9ab4 100644 Binary files a/MVVM/.vs/MVVM/v17/.futdcache.v2 and b/MVVM/.vs/MVVM/v17/.futdcache.v2 differ diff --git a/MVVM/.vs/MVVM/v17/.suo b/MVVM/.vs/MVVM/v17/.suo index e2789395..b71eb4fb 100644 Binary files a/MVVM/.vs/MVVM/v17/.suo and b/MVVM/.vs/MVVM/v17/.suo differ diff --git a/MVVM/.vs/ProjectEvaluation/mvvm.metadata.v7.bin b/MVVM/.vs/ProjectEvaluation/mvvm.metadata.v7.bin index f7583c34..3bbbccb3 100644 Binary files a/MVVM/.vs/ProjectEvaluation/mvvm.metadata.v7.bin and b/MVVM/.vs/ProjectEvaluation/mvvm.metadata.v7.bin differ diff --git a/MVVM/.vs/ProjectEvaluation/mvvm.projects.v7.bin b/MVVM/.vs/ProjectEvaluation/mvvm.projects.v7.bin index bfa63cd5..aec44f69 100644 Binary files a/MVVM/.vs/ProjectEvaluation/mvvm.projects.v7.bin and b/MVVM/.vs/ProjectEvaluation/mvvm.projects.v7.bin differ diff --git a/MVVM/MVVM/MVVM.csproj.user b/MVVM/MVVM/MVVM.csproj.user index 36acfe87..606cc6df 100644 --- a/MVVM/MVVM/MVVM.csproj.user +++ b/MVVM/MVVM/MVVM.csproj.user @@ -3,8 +3,8 @@ False net7.0-android - Émulateur Android - Emulator + Samsung SM-A705FN (Android 11.0 - API 30) + PhysicalDevice ios-arm64 diff --git a/MVVM/MVVM/Pages/BooksPage.xaml b/MVVM/MVVM/Pages/BooksPage.xaml index b33e3880..e198769b 100644 --- a/MVVM/MVVM/Pages/BooksPage.xaml +++ b/MVVM/MVVM/Pages/BooksPage.xaml @@ -22,17 +22,24 @@ - + + + + + + + + - - + diff --git a/MVVM/MVVM/Pages/BooksPage.xaml.cs b/MVVM/MVVM/Pages/BooksPage.xaml.cs index 2634d41a..18dbf518 100644 --- a/MVVM/MVVM/Pages/BooksPage.xaml.cs +++ b/MVVM/MVVM/Pages/BooksPage.xaml.cs @@ -12,8 +12,8 @@ public partial class BooksPage : ContentPage { InitializeComponent(); - collectionView.ItemsSource = bookViewModel.Books; + collectionView.ItemsSource = bookViewModel.GroupBooks; } - -} \ No newline at end of file + +} \ No newline at end of file diff --git a/MVVM/MVVM/Pages/Component/Livre.xaml b/MVVM/MVVM/Pages/Component/Livre.xaml index c65186c6..75ac3485 100644 --- a/MVVM/MVVM/Pages/Component/Livre.xaml +++ b/MVVM/MVVM/Pages/Component/Livre.xaml @@ -5,13 +5,13 @@ - + - diff --git a/MVVM/MVVM/Pages/Component/Livre.xaml.cs b/MVVM/MVVM/Pages/Component/Livre.xaml.cs index aebf3be5..37f849ec 100644 --- a/MVVM/MVVM/Pages/Component/Livre.xaml.cs +++ b/MVVM/MVVM/Pages/Component/Livre.xaml.cs @@ -1,15 +1,17 @@ +using Model; using System.Reflection; +using ToolKit; namespace MVVM.Pages.Component; public partial class Livre : ContentView { - + public static readonly BindableProperty TitreCompProperty = BindableProperty.Create(nameof(TitreComp), typeof(string), typeof(Livre), string.Empty); public static readonly BindableProperty ImageCompProperty = BindableProperty.Create(nameof(ImageComp), typeof(string), typeof(Livre), string.Empty); - public static readonly BindableProperty AuteurCompProperty = BindableProperty.Create(nameof(AuteurComp), typeof(string), typeof(Livre), string.Empty); - public static readonly BindableProperty NoteCompProperty = BindableProperty.Create(nameof(NoteComp), typeof(string), typeof(Livre), string.Empty); + public static readonly BindableProperty AuteurCompProperty = BindableProperty.Create(nameof(AuteurComp), typeof(string), typeof(string),null); + public static readonly BindableProperty UserRatingCompProperty = BindableProperty.Create(nameof(UserRatingComp), typeof(float), typeof(Livre), null); @@ -27,39 +29,49 @@ public partial class Livre : ContentView public string AuteurComp { - get => (string)GetValue(Livre.AuteurCompProperty); + get + { /* + List list = (List)GetValue(Livre.AuteurCompProperty); + string auth = ""; + for(int i = 0 ; i < list.Count;i++) + { + auth += list[i].Name; + if ( i < list.Count - 1) + { + auth += ", "; + } + } + return auth;*/ + return (string)GetValue(Livre.AuteurCompProperty); + } set => SetValue(Livre.AuteurCompProperty, value); } - public string NoteComp + public float UserRatingComp { get { - string note = (string)GetValue(Livre.NoteCompProperty); + float note = (float)GetValue(Livre.UserRatingCompProperty); imageStar(note); return note; } - set => SetValue(Livre.NoteCompProperty, value); + set => SetValue(Livre.UserRatingCompProperty, value); } public Livre() { InitializeComponent(); - Titre.SetBinding(Label.TextProperty, new Binding(nameof(TitreComp), source: this)); - Image.SetBinding(Image.SourceProperty, new Binding(nameof(ImageComp), source: this)); - Auteur.SetBinding(Label.TextProperty, new Binding(nameof(AuteurComp), source: this)); - Note.SetBinding(Label.TextProperty, new Binding(nameof (NoteComp), source: this)); + TitreXAML.SetBinding(Label.TextProperty, new Binding(nameof(TitreComp), source: this)); + ImageXAML.SetBinding(Image.SourceProperty, new Binding(nameof(ImageComp), source: this)); + AuteurXAML.SetBinding(Label.TextProperty, new Binding(nameof(AuteurComp), source: this)); + NoteXAML.SetBinding(Label.TextProperty, new Binding(nameof (UserRatingComp), source: this)); } - private void imageStar(string note) - { - if (note == null || note.Length == 0) - { - return; - } - int tmp = int.Parse(note); + private void imageStar(float note) + { + int tmp = (int)note; if (tmp > 0 ) { @@ -82,4 +94,43 @@ public partial class Livre : ContentView etoile5.Source = "etoile"; } } + + /* + public string ImageSmall + { + get { return imageSmall; } + set { imageSmall = value; } + } + private string imageSmall; + + public string Title + { + get { return title; } + set { title = value; } + } + private string title; + + public string Author + { + get { return author; } + set { author = value; } + } + private string author; + + public string Note + { + get { return note; } + set { note = value; } + } + private string note; + + + public Livre() + { + InitializeComponent(); + //ImageXAML.SetBinding(Image.SourceProperty, ImageSmall); + //AuteurXAML.SetBinding(Label.TextProperty, Author); + //NoteXAML.SetBinding (Label.TextProperty, Note); + }*/ + } \ No newline at end of file diff --git a/MVVM/MVVM/Pages/EmpruntPret.xaml b/MVVM/MVVM/Pages/EmpruntPret.xaml index 8d1e3f39..551a0300 100644 --- a/MVVM/MVVM/Pages/EmpruntPret.xaml +++ b/MVVM/MVVM/Pages/EmpruntPret.xaml @@ -45,7 +45,7 @@ - + diff --git a/MVVM/MVVM/Pages/MyLibraryPage.xaml b/MVVM/MVVM/Pages/MyLibraryPage.xaml index 188c5c8b..c2d7957e 100644 --- a/MVVM/MVVM/Pages/MyLibraryPage.xaml +++ b/MVVM/MVVM/Pages/MyLibraryPage.xaml @@ -44,7 +44,7 @@ diff --git a/MVVM/MVVM/Pages/MyLibraryPage.xaml.cs b/MVVM/MVVM/Pages/MyLibraryPage.xaml.cs index 9933bfda..d384bc92 100644 --- a/MVVM/MVVM/Pages/MyLibraryPage.xaml.cs +++ b/MVVM/MVVM/Pages/MyLibraryPage.xaml.cs @@ -1,4 +1,5 @@ using MVVM.VmApplicatif; +using Wrapper; namespace MVVM.Pages; @@ -6,10 +7,13 @@ public partial class MyLibraryPage : ContentPage { public NavigateAndLoadBooks NavigateAndLoadBooks { get; set;} - public MyLibraryPage(NavigateAndLoadBooks navigateAndLoadBooks) + public BooksViewModel BooksViewModel { get; set;} + + public MyLibraryPage(NavigateAndLoadBooks navigateAndLoadBooks, BooksViewModel bookViewModel) { this.NavigateAndLoadBooks = navigateAndLoadBooks; - //BindingContext = NavigateAndLoadBooks.BooksViewModel.Books; + this.BooksViewModel = bookViewModel; + BindingContext = this; InitializeComponent(); } diff --git a/MVVM/MVVM/bin/Debug/net7.0-android/MVVM.dll b/MVVM/MVVM/bin/Debug/net7.0-android/MVVM.dll index 26744ae1..a0bc09c3 100644 Binary files a/MVVM/MVVM/bin/Debug/net7.0-android/MVVM.dll and b/MVVM/MVVM/bin/Debug/net7.0-android/MVVM.dll differ diff --git a/MVVM/MVVM/bin/Debug/net7.0-android/MVVM.pdb b/MVVM/MVVM/bin/Debug/net7.0-android/MVVM.pdb index 66b0dffd..e09a0ed3 100644 Binary files a/MVVM/MVVM/bin/Debug/net7.0-android/MVVM.pdb and b/MVVM/MVVM/bin/Debug/net7.0-android/MVVM.pdb differ diff --git a/MVVM/MVVM/bin/Debug/net7.0-android/Model.dll b/MVVM/MVVM/bin/Debug/net7.0-android/Model.dll index 99df8ff0..52c49979 100644 Binary files a/MVVM/MVVM/bin/Debug/net7.0-android/Model.dll and b/MVVM/MVVM/bin/Debug/net7.0-android/Model.dll differ diff --git a/MVVM/MVVM/bin/Debug/net7.0-android/Model.pdb b/MVVM/MVVM/bin/Debug/net7.0-android/Model.pdb index ab4de1b8..12e51926 100644 Binary files a/MVVM/MVVM/bin/Debug/net7.0-android/Model.pdb and b/MVVM/MVVM/bin/Debug/net7.0-android/Model.pdb differ diff --git a/MVVM/MVVM/bin/Debug/net7.0-android/Wrapper.dll b/MVVM/MVVM/bin/Debug/net7.0-android/Wrapper.dll index 0c0a8020..39f3ce89 100644 Binary files a/MVVM/MVVM/bin/Debug/net7.0-android/Wrapper.dll and b/MVVM/MVVM/bin/Debug/net7.0-android/Wrapper.dll differ diff --git a/MVVM/MVVM/bin/Debug/net7.0-android/Wrapper.pdb b/MVVM/MVVM/bin/Debug/net7.0-android/Wrapper.pdb index 2ea6dc34..bdc5c9d8 100644 Binary files a/MVVM/MVVM/bin/Debug/net7.0-android/Wrapper.pdb and b/MVVM/MVVM/bin/Debug/net7.0-android/Wrapper.pdb differ diff --git a/MVVM/MVVM/bin/Debug/net7.0-android/com.companyname.mvvm.apk b/MVVM/MVVM/bin/Debug/net7.0-android/com.companyname.mvvm.apk deleted file mode 100644 index 44336ad0..00000000 Binary files a/MVVM/MVVM/bin/Debug/net7.0-android/com.companyname.mvvm.apk and /dev/null differ diff --git a/MVVM/MVVM/obj/Debug/net7.0-android/MVVM.csproj.AssemblyReference.cache b/MVVM/MVVM/obj/Debug/net7.0-android/MVVM.csproj.AssemblyReference.cache index 1eb3b00f..bdaaf231 100644 Binary files a/MVVM/MVVM/obj/Debug/net7.0-android/MVVM.csproj.AssemblyReference.cache and b/MVVM/MVVM/obj/Debug/net7.0-android/MVVM.csproj.AssemblyReference.cache differ diff --git a/MVVM/MVVM/obj/Debug/net7.0-android/MVVM.dll b/MVVM/MVVM/obj/Debug/net7.0-android/MVVM.dll index 26744ae1..a0bc09c3 100644 Binary files a/MVVM/MVVM/obj/Debug/net7.0-android/MVVM.dll and b/MVVM/MVVM/obj/Debug/net7.0-android/MVVM.dll differ diff --git a/MVVM/MVVM/obj/Debug/net7.0-android/MVVM.pdb b/MVVM/MVVM/obj/Debug/net7.0-android/MVVM.pdb index 66b0dffd..e09a0ed3 100644 Binary files a/MVVM/MVVM/obj/Debug/net7.0-android/MVVM.pdb and b/MVVM/MVVM/obj/Debug/net7.0-android/MVVM.pdb differ diff --git a/MVVM/MVVM/obj/Debug/net7.0-android/android-arm64/MVVM.csproj.AssemblyReference.cache b/MVVM/MVVM/obj/Debug/net7.0-android/android-arm64/MVVM.csproj.AssemblyReference.cache index 1eb3b00f..9f39ee99 100644 Binary files a/MVVM/MVVM/obj/Debug/net7.0-android/android-arm64/MVVM.csproj.AssemblyReference.cache and b/MVVM/MVVM/obj/Debug/net7.0-android/android-arm64/MVVM.csproj.AssemblyReference.cache differ diff --git a/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/MVVM.dll b/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/MVVM.dll index 26744ae1..a0bc09c3 100644 Binary files a/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/MVVM.dll and b/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/MVVM.dll differ diff --git a/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/MVVM.pdb b/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/MVVM.pdb index 66b0dffd..e09a0ed3 100644 Binary files a/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/MVVM.pdb and b/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/MVVM.pdb differ diff --git a/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/Model.dll b/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/Model.dll index 99df8ff0..52c49979 100644 Binary files a/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/Model.dll and b/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/Model.dll differ diff --git a/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/Model.pdb b/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/Model.pdb index ab4de1b8..12e51926 100644 Binary files a/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/Model.pdb and b/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/Model.pdb differ diff --git a/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/Wrapper.dll b/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/Wrapper.dll index 0c0a8020..39f3ce89 100644 Binary files a/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/Wrapper.dll and b/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/Wrapper.dll differ diff --git a/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/Wrapper.pdb b/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/Wrapper.pdb index 2ea6dc34..bdc5c9d8 100644 Binary files a/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/Wrapper.pdb and b/MVVM/MVVM/obj/Debug/net7.0-android/android/assets/Wrapper.pdb differ diff --git a/MVVM/MVVM/obj/Debug/net7.0-android/devices.cache b/MVVM/MVVM/obj/Debug/net7.0-android/devices.cache index de1ce4be..8b1c4063 100644 --- a/MVVM/MVVM/obj/Debug/net7.0-android/devices.cache +++ b/MVVM/MVVM/obj/Debug/net7.0-android/devices.cache @@ -1 +1 @@ -arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:3 \ No newline at end of file +arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:3arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:4arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:5arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:5arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:5arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:5arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:5arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6arm64-v8a30product:a70qeea;model:SM_A705FN;device:a70q;transport_id:6 \ No newline at end of file diff --git a/MVVM/MVVM/obj/Debug/net7.0-ios/iossimulator-x64/MVVM.csproj.AssemblyReference.cache b/MVVM/MVVM/obj/Debug/net7.0-ios/iossimulator-x64/MVVM.csproj.AssemblyReference.cache index 421b1aa8..6fc40460 100644 Binary files a/MVVM/MVVM/obj/Debug/net7.0-ios/iossimulator-x64/MVVM.csproj.AssemblyReference.cache and b/MVVM/MVVM/obj/Debug/net7.0-ios/iossimulator-x64/MVVM.csproj.AssemblyReference.cache differ diff --git a/MVVM/MVVM/obj/Debug/net7.0-maccatalyst/maccatalyst-x64/MVVM.csproj.AssemblyReference.cache b/MVVM/MVVM/obj/Debug/net7.0-maccatalyst/maccatalyst-x64/MVVM.csproj.AssemblyReference.cache index 18c64b74..43e99728 100644 Binary files a/MVVM/MVVM/obj/Debug/net7.0-maccatalyst/maccatalyst-x64/MVVM.csproj.AssemblyReference.cache and b/MVVM/MVVM/obj/Debug/net7.0-maccatalyst/maccatalyst-x64/MVVM.csproj.AssemblyReference.cache differ diff --git a/MVVM/MVVM/obj/Debug/net7.0-windows10.0.19041.0/win10-x64/MVVM.csproj.AssemblyReference.cache b/MVVM/MVVM/obj/Debug/net7.0-windows10.0.19041.0/win10-x64/MVVM.csproj.AssemblyReference.cache index 32d2ed39..48a469a9 100644 Binary files a/MVVM/MVVM/obj/Debug/net7.0-windows10.0.19041.0/win10-x64/MVVM.csproj.AssemblyReference.cache and b/MVVM/MVVM/obj/Debug/net7.0-windows10.0.19041.0/win10-x64/MVVM.csproj.AssemblyReference.cache differ diff --git a/MVVM/MVVM/obj/Debug/net7.0-windows10.0.19041.0/win10-x64/XamlSaveStateFile.xml b/MVVM/MVVM/obj/Debug/net7.0-windows10.0.19041.0/win10-x64/XamlSaveStateFile.xml index 98b32884..d4a6f7d2 100644 --- a/MVVM/MVVM/obj/Debug/net7.0-windows10.0.19041.0/win10-x64/XamlSaveStateFile.xml +++ b/MVVM/MVVM/obj/Debug/net7.0-windows10.0.19041.0/win10-x64/XamlSaveStateFile.xml @@ -1 +1 @@ -EnableXBindDiagnostics, EnableDefaultValidationContextGeneration, EnableWin32Codegen, UsingCSWinRT \ No newline at end of file +EnableXBindDiagnostics, EnableDefaultValidationContextGeneration, EnableWin32Codegen, UsingCSWinRT \ No newline at end of file diff --git a/MVVM/Model/Book.cs b/MVVM/Model/Book.cs index 092b1b8d..3d5d8f0d 100644 --- a/MVVM/Model/Book.cs +++ b/MVVM/Model/Book.cs @@ -21,7 +21,7 @@ public class Book : IEquatable public List Authors { get; set; } = new List(); public Status Status { get; set; } public List UserTags { get; set; } = new List(); - public float? UserRating { get; set; } + public float? UserRating { get; set; } public string UserNote { get; set; } public bool Equals(Book? other) diff --git a/MVVM/Model/bin/Debug/net7.0/Model.dll b/MVVM/Model/bin/Debug/net7.0/Model.dll index 99df8ff0..52c49979 100644 Binary files a/MVVM/Model/bin/Debug/net7.0/Model.dll and b/MVVM/Model/bin/Debug/net7.0/Model.dll differ diff --git a/MVVM/Model/bin/Debug/net7.0/Model.pdb b/MVVM/Model/bin/Debug/net7.0/Model.pdb index ab4de1b8..12e51926 100644 Binary files a/MVVM/Model/bin/Debug/net7.0/Model.pdb and b/MVVM/Model/bin/Debug/net7.0/Model.pdb differ diff --git a/MVVM/Model/obj/Debug/net7.0/Model.dll b/MVVM/Model/obj/Debug/net7.0/Model.dll index 99df8ff0..52c49979 100644 Binary files a/MVVM/Model/obj/Debug/net7.0/Model.dll and b/MVVM/Model/obj/Debug/net7.0/Model.dll differ diff --git a/MVVM/Model/obj/Debug/net7.0/Model.pdb b/MVVM/Model/obj/Debug/net7.0/Model.pdb index ab4de1b8..12e51926 100644 Binary files a/MVVM/Model/obj/Debug/net7.0/Model.pdb and b/MVVM/Model/obj/Debug/net7.0/Model.pdb differ diff --git a/MVVM/Stub/bin/Debug/net7.0/Model.dll b/MVVM/Stub/bin/Debug/net7.0/Model.dll index 99df8ff0..52c49979 100644 Binary files a/MVVM/Stub/bin/Debug/net7.0/Model.dll and b/MVVM/Stub/bin/Debug/net7.0/Model.dll differ diff --git a/MVVM/Stub/bin/Debug/net7.0/Model.pdb b/MVVM/Stub/bin/Debug/net7.0/Model.pdb index ab4de1b8..12e51926 100644 Binary files a/MVVM/Stub/bin/Debug/net7.0/Model.pdb and b/MVVM/Stub/bin/Debug/net7.0/Model.pdb differ diff --git a/MVVM/Stub/obj/Debug/net7.0/Stub.csproj.AssemblyReference.cache b/MVVM/Stub/obj/Debug/net7.0/Stub.csproj.AssemblyReference.cache index 37d05671..394cc9a7 100644 Binary files a/MVVM/Stub/obj/Debug/net7.0/Stub.csproj.AssemblyReference.cache and b/MVVM/Stub/obj/Debug/net7.0/Stub.csproj.AssemblyReference.cache differ diff --git a/MVVM/Wrapper/BooksViewModel.cs b/MVVM/Wrapper/BooksViewModel.cs index c910fe62..227db26f 100644 --- a/MVVM/Wrapper/BooksViewModel.cs +++ b/MVVM/Wrapper/BooksViewModel.cs @@ -20,70 +20,91 @@ namespace Wrapper } private readonly List books;*/ - public ObservableCollection Books - { - get => Books; - private set - { - Books = value; - //UpdateGroupBooks(); - } - } - + + public ObservableCollection Books = new ObservableCollection(); public ObservableCollection GroupBooks { get; private set; } = new ObservableCollection(); public BooksViewModel(ILibraryManager libraryManager,IUserLibraryManager userLibraryManager) { - Books = new ObservableCollection(); Manager = new Manager(libraryManager, userLibraryManager); LoadBooks = new RelayCommand(o => LoadBooksFromManager()); - Count = 2; + Count = 7; + LoadBooksFromManager(); } - /* + private void UpdateGroupBooks() { GroupBooks.Clear(); foreach (Book book in Books) { - foreach (Author author in book.Authors) - { - int find = -1; - for(int i = 0; i < GroupBooks.Count(); i++) + if (book.Authors.Count != 0) + { + foreach (Author author in book.Authors) { - if (GroupBooks[i].Author == author.Name ) - { - find = i; - break; - } + Console.WriteLine(author.Name); + int find = -1; + for (int i = 0; i < GroupBooks.Count(); i++) + { + if (GroupBooks[i].Author == author.Name) + { + find = i; + break; + } + } + Console.WriteLine("l - 55"); + if (find != -1) + { + Console.WriteLine("l - 58"); + GroupBooks[find].Add(book); + } + else + { + Console.WriteLine("l - 63"); + GroupBooks.Add(new GroupBooks(author.Name, new List { book })); + } } - - if ( find != -1 ) + } + else + { + int index = -1; + for ( int i = 0; i < GroupBooks.Count(); i++) { - GroupBooks[find].Add(book); + if (GroupBooks[i].Author == "Inconnu") + { + index = i; + break; + } } - else + if (index == -1) { - GroupBooks.Add(new GroupBooks(author.Name, new List{book})); + GroupBooks.Add(new GroupBooks("Inconnu", new List { book })); + } else + { + GroupBooks[index].Add(book); } } } Console.WriteLine(GroupBooks.Count); - }*/ + } + private void LoadBooksFromManager() { var result = Manager.GetBooksFromCollection(index,count,""); - if (result.Result.count == 0 ) { return ; } + if (result.Result.books.Count() == 0 ) { return ; } Books.Clear(); foreach (Book book in result.Result.books) { Books.Add(book); } + NbBook = result.Result.count; + + UpdateGroupBooks(); } public int Index { @@ -109,5 +130,16 @@ namespace Wrapper } private int count; + + public long NbBook + { + get { return nbBook; } + private set + { + setProperty(ref nbBook, value); + } + + } + private long nbBook; } } \ No newline at end of file diff --git a/MVVM/Wrapper/bin/Debug/net7.0/Model.dll b/MVVM/Wrapper/bin/Debug/net7.0/Model.dll index 99df8ff0..52c49979 100644 Binary files a/MVVM/Wrapper/bin/Debug/net7.0/Model.dll and b/MVVM/Wrapper/bin/Debug/net7.0/Model.dll differ diff --git a/MVVM/Wrapper/bin/Debug/net7.0/Model.pdb b/MVVM/Wrapper/bin/Debug/net7.0/Model.pdb index ab4de1b8..12e51926 100644 Binary files a/MVVM/Wrapper/bin/Debug/net7.0/Model.pdb and b/MVVM/Wrapper/bin/Debug/net7.0/Model.pdb differ diff --git a/MVVM/Wrapper/bin/Debug/net7.0/Wrapper.dll b/MVVM/Wrapper/bin/Debug/net7.0/Wrapper.dll index 0c0a8020..39f3ce89 100644 Binary files a/MVVM/Wrapper/bin/Debug/net7.0/Wrapper.dll and b/MVVM/Wrapper/bin/Debug/net7.0/Wrapper.dll differ diff --git a/MVVM/Wrapper/bin/Debug/net7.0/Wrapper.pdb b/MVVM/Wrapper/bin/Debug/net7.0/Wrapper.pdb index 2ea6dc34..bdc5c9d8 100644 Binary files a/MVVM/Wrapper/bin/Debug/net7.0/Wrapper.pdb and b/MVVM/Wrapper/bin/Debug/net7.0/Wrapper.pdb differ diff --git a/MVVM/Wrapper/obj/Debug/net7.0/Wrapper.csproj.AssemblyReference.cache b/MVVM/Wrapper/obj/Debug/net7.0/Wrapper.csproj.AssemblyReference.cache index 37c1ccc1..cac86c3f 100644 Binary files a/MVVM/Wrapper/obj/Debug/net7.0/Wrapper.csproj.AssemblyReference.cache and b/MVVM/Wrapper/obj/Debug/net7.0/Wrapper.csproj.AssemblyReference.cache differ diff --git a/MVVM/Wrapper/obj/Debug/net7.0/Wrapper.dll b/MVVM/Wrapper/obj/Debug/net7.0/Wrapper.dll index 0c0a8020..39f3ce89 100644 Binary files a/MVVM/Wrapper/obj/Debug/net7.0/Wrapper.dll and b/MVVM/Wrapper/obj/Debug/net7.0/Wrapper.dll differ diff --git a/MVVM/Wrapper/obj/Debug/net7.0/Wrapper.pdb b/MVVM/Wrapper/obj/Debug/net7.0/Wrapper.pdb index 2ea6dc34..bdc5c9d8 100644 Binary files a/MVVM/Wrapper/obj/Debug/net7.0/Wrapper.pdb and b/MVVM/Wrapper/obj/Debug/net7.0/Wrapper.pdb differ diff --git a/MVVM/Wrapper/obj/Debug/net7.0/ref/Wrapper.dll b/MVVM/Wrapper/obj/Debug/net7.0/ref/Wrapper.dll index e325d9dc..2d5efb97 100644 Binary files a/MVVM/Wrapper/obj/Debug/net7.0/ref/Wrapper.dll and b/MVVM/Wrapper/obj/Debug/net7.0/ref/Wrapper.dll differ diff --git a/MVVM/Wrapper/obj/Debug/net7.0/refint/Wrapper.dll b/MVVM/Wrapper/obj/Debug/net7.0/refint/Wrapper.dll index e325d9dc..2d5efb97 100644 Binary files a/MVVM/Wrapper/obj/Debug/net7.0/refint/Wrapper.dll and b/MVVM/Wrapper/obj/Debug/net7.0/refint/Wrapper.dll differ