|
|
@ -1,6 +1,7 @@
|
|
|
|
using Model;
|
|
|
|
using Model;
|
|
|
|
using Model.Group;
|
|
|
|
using Model.Group;
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
using System.Collections.ObjectModel;
|
|
|
|
|
|
|
|
using System.Reflection.Metadata.Ecma335;
|
|
|
|
using System.Xml.Linq;
|
|
|
|
using System.Xml.Linq;
|
|
|
|
using ToolKit;
|
|
|
|
using ToolKit;
|
|
|
|
|
|
|
|
|
|
|
@ -10,95 +11,58 @@ namespace Wrapper
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ILibraryManager LibraryManager { get; set; }
|
|
|
|
ILibraryManager LibraryManager { get; set; }
|
|
|
|
|
|
|
|
|
|
|
|
private string _valeurTmp { get; set; }
|
|
|
|
/*
|
|
|
|
public string ValeurTmp
|
|
|
|
public ReadOnlyObservableCollection<Book> Books { get; set; }
|
|
|
|
|
|
|
|
private ReadOnlyObservableCollection<Book> books
|
|
|
|
{
|
|
|
|
{
|
|
|
|
get => _valeurTmp;
|
|
|
|
get => Books;
|
|
|
|
set
|
|
|
|
set
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (string.Equals(_valeurTmp, value)) return;
|
|
|
|
if (value == null) { return; }
|
|
|
|
_valeurTmp = value;
|
|
|
|
setProperty(books, value);
|
|
|
|
NotifyPropertyChange();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
|
|
public ObservableCollection<GroupeLivre> listeGroupLivre { get; set; } = new ObservableCollection<GroupeLivre>();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public BookViewModel(ILibraryManager _libraryManager)
|
|
|
|
public BookViewModel(ILibraryManager _libraryManager)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
this.LibraryManager = _libraryManager;
|
|
|
|
this.LibraryManager = _libraryManager;
|
|
|
|
getLivre();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public int Index {
|
|
|
|
|
|
|
|
get { return index; }
|
|
|
|
|
|
|
|
private set
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
setProperty(ref index, value);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public void getBooks()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
//LibraryManager.GetBooksByAuthor();
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private int index;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void getLivre()
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
LibraryManager.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
listeGroupLivre.Clear();
|
|
|
|
public int Count
|
|
|
|
foreach (var item in LibraryManager.GetBooksByAuthor)
|
|
|
|
{
|
|
|
|
|
|
|
|
get { return count; }
|
|
|
|
|
|
|
|
private set
|
|
|
|
{
|
|
|
|
{
|
|
|
|
listeGroupLivre.Add(item);
|
|
|
|
setProperty(ref count, value);
|
|
|
|
}*/
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
|
|
|
listeGroupLivre.Add(new GroupeLivre("Eiichirō Oda",
|
|
|
|
|
|
|
|
new List<Livre> {
|
|
|
|
|
|
|
|
new Livre { Auteur = "Eiichirō Oda",
|
|
|
|
|
|
|
|
Titre = "One piece tome 1",
|
|
|
|
|
|
|
|
Note ="5",
|
|
|
|
|
|
|
|
Statut = "Lu",
|
|
|
|
|
|
|
|
Image = "onepiece1"},
|
|
|
|
|
|
|
|
new Livre { Auteur = "Eiichirō Oda",
|
|
|
|
|
|
|
|
Titre = "One piece tome 2",
|
|
|
|
|
|
|
|
Note = "4",
|
|
|
|
|
|
|
|
Statut = "Lu",
|
|
|
|
|
|
|
|
Image = "onepiece2",
|
|
|
|
|
|
|
|
Separateur = false}}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
private int count;
|
|
|
|
|
|
|
|
|
|
|
|
listeGroupLivre.Add(new GroupeLivre("Tite Kubo",
|
|
|
|
|
|
|
|
new List<Livre>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
new Livre { Auteur = "Tite Kubo",
|
|
|
|
|
|
|
|
Titre = "Bleach tome 1",
|
|
|
|
|
|
|
|
Note = "3",
|
|
|
|
|
|
|
|
Statut = "Lu",
|
|
|
|
|
|
|
|
Image = "bleach1",
|
|
|
|
|
|
|
|
Separateur = false}
|
|
|
|
|
|
|
|
}));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
listeGroupLivre.Add(new GroupeLivre("Masashi Kishimoto", new List<Livre> {
|
|
|
|
public int NbBook
|
|
|
|
new Livre { Auteur = "Masashi Kishimoto",
|
|
|
|
{
|
|
|
|
Titre = "Naruto tome 1",
|
|
|
|
get { return nbBook; }
|
|
|
|
Note = "5",
|
|
|
|
private set
|
|
|
|
Statut = "Lu",
|
|
|
|
{
|
|
|
|
Image = "naruto1"},
|
|
|
|
setProperty(ref nbBook, value);
|
|
|
|
new Livre { Auteur = "Masashi Kishimoto",
|
|
|
|
}
|
|
|
|
Titre = "Naruto tome 2",
|
|
|
|
|
|
|
|
Note = "2",
|
|
|
|
|
|
|
|
Statut = "Lu",
|
|
|
|
|
|
|
|
Image = "naruto2"},
|
|
|
|
|
|
|
|
new Livre
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
Auteur = "Masashi Kishimoto",
|
|
|
|
|
|
|
|
Titre = "Naruto tome 3",
|
|
|
|
|
|
|
|
Note = "3",
|
|
|
|
|
|
|
|
Statut = "Lu",
|
|
|
|
|
|
|
|
Image = "naruto3",
|
|
|
|
|
|
|
|
Separateur = false
|
|
|
|
|
|
|
|
}}));*/
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
private int nbBook;
|
|
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|