You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
53 lines
1.3 KiB
53 lines
1.3 KiB
using Model;
|
|
using System.Collections.ObjectModel;
|
|
using VMWrapper;
|
|
using static System.Runtime.InteropServices.JavaScript.JSType;
|
|
|
|
namespace BookApp.ViewModel;
|
|
|
|
|
|
|
|
public class ViewModelManager
|
|
{
|
|
|
|
BookViewModel _viewModel;
|
|
public ObservableCollection<Author> Authors { get; set; } = new ObservableCollection<Author>();
|
|
|
|
/* public ObservableCollection<AuteurGroup> AuteurGroups { get; private set; } =
|
|
new ObservableCollection<AuteurGroup>();*/
|
|
|
|
public ViewModelManager(BookViewModel viewModel)
|
|
{
|
|
|
|
_viewModel = viewModel;
|
|
//GetAuthors();
|
|
/* ObservableCollection<Auteur> auteurs = new Stub().CreateStubData();
|
|
foreach (Auteur auteur in auteurs)
|
|
{
|
|
AuteurGroups.Add(new AuteurGroup(auteur.Name, auteur.Books));
|
|
}*/
|
|
}
|
|
|
|
//fireandforget
|
|
/*public async void GetAuthors()
|
|
{
|
|
|
|
var authors1 = await _viewModel.GetAuthors();
|
|
Authors.Clear();
|
|
foreach (var author in authors1)
|
|
{
|
|
Authors.Add(author);
|
|
}
|
|
}*/
|
|
}
|
|
|
|
/*public class AuteurGroup : ObservableCollection<Book>
|
|
{
|
|
public string Name { get; private set; }
|
|
|
|
public AuteurGroup(string name, ObservableCollection<Book> books)
|
|
: base(books)
|
|
{
|
|
Name = name;
|
|
}
|
|
}*/ |