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.
34 lines
954 B
34 lines
954 B
using Model;
|
|
|
|
namespace VMWrapper
|
|
{
|
|
public class SearchBarViewModel
|
|
{
|
|
private readonly ILibraryManager data;
|
|
|
|
public SearchBarViewModel(ILibraryManager data)
|
|
{
|
|
this.data = data;
|
|
}
|
|
|
|
public async void SearchAuthor(string nomSearch)
|
|
{
|
|
try
|
|
{
|
|
var (totalA, authors) = await data.GetAuthorsByName(nomSearch, 0, 5);
|
|
|
|
/*foreach (Author author in authors)
|
|
{
|
|
var books = data.GetBooksByAuthor(author.Name, 0, 5).Result.Item2;
|
|
var observableBooks = new ObservableCollection<Book>(books);
|
|
AuteurGroups.Add(new AuteurGroup(author.Name, observableBooks));
|
|
}*/
|
|
}
|
|
catch (Exception ex)
|
|
{
|
|
System.Diagnostics.Debug.WriteLine(ex.Message);
|
|
}
|
|
}
|
|
}
|
|
}
|