ADD : Infos en ligne + Description

fix-bugs-22-10
Lou BRODA 1 year ago
parent c63ed977fa
commit aa96dc3442

@ -102,6 +102,9 @@
<toolkit:IconTintColorBehavior TintColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}"/> <toolkit:IconTintColorBehavior TintColor="{AppThemeBinding Light={StaticResource Black}, Dark={StaticResource White}}"/>
</Image.Behaviors> </Image.Behaviors>
</Image> </Image>
<Grid.GestureRecognizers>
<TapGestureRecognizer Command="{Binding DetailsLivreVM.OpenInfoCommand}"/>
</Grid.GestureRecognizers>
</Grid> </Grid>
<contentView:SeparatorCutStartView/> <contentView:SeparatorCutStartView/>
@ -178,7 +181,7 @@
<Label Text="Résumé" <Label Text="Résumé"
Style="{StaticResource DetailsLivreTitle}" Style="{StaticResource DetailsLivreTitle}"
Grid.Row="0"/> Grid.Row="0"/>
<Label Text="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Et malesuada fames ac turpis egestas integer eget aliquet. Nunc sed id semper risus. Nisl purus in mollis nunc sed id semper risus. Egestas congue quisque egestas diam in arcu cursus euismod. Elementum integer enim neque volutpat ac tincidunt vitae. Amet luctus venenatis lectus magna fringilla urna porttitor rhoncus dolor. Sollicitudin tempor id eu nisl nunc. Eget mauris pharetra et ultrices neque. In vitae turpis massa sed elementum tempus. Posuere ac ut consequat semper viverra nam. Quisque non tellus orci ac auctor augue mauris augue. Cursus in hac habitasse platea dictumst. Pellentesque diam volutpat commodo sed egestas egestas fringilla phasellus faucibus. Vel fringilla est ullamcorper eget nulla facilisi etiam." <Label Text="{Binding DetailsLivreVM.Book.WorkDescription}"
Style="{StaticResource DetailsLivreBody}" Style="{StaticResource DetailsLivreBody}"
Grid.Row="1"/> Grid.Row="1"/>
</Grid> </Grid>

@ -77,6 +77,8 @@ namespace LivreLand.ViewModel
public ICommand RemoveBookCommand { get; private set; } public ICommand RemoveBookCommand { get; private set; }
public ICommand OpenInfoCommand { get; private set; }
#endregion #endregion
#region Constructor #region Constructor
@ -92,6 +94,7 @@ namespace LivreLand.ViewModel
AddBookToReadListCommand = new RelayCommand<BookVM>((bookVM) => AddBookToReadList(bookVM)); AddBookToReadListCommand = new RelayCommand<BookVM>((bookVM) => AddBookToReadList(bookVM));
LoanBookCommand = new RelayCommand<BookVM>((bookVM) => LoanBook(bookVM)); LoanBookCommand = new RelayCommand<BookVM>((bookVM) => LoanBook(bookVM));
RemoveBookCommand = new RelayCommand<BookVM>((bookVM) => RemoveBook(bookVM)); RemoveBookCommand = new RelayCommand<BookVM>((bookVM) => RemoveBook(bookVM));
OpenInfoCommand = new RelayCommand(() => OpenInfo());
} }
#endregion #endregion
@ -167,6 +170,13 @@ namespace LivreLand.ViewModel
Navigator.PopupBackButtonNavigationCommand.Execute(null); Navigator.PopupBackButtonNavigationCommand.Execute(null);
} }
private async Task OpenInfo()
{
var isbn = Manager.SelectedBook.ISBN13;
string url = "https://openlibrary.org/isbn/" + isbn;
await Launcher.OpenAsync(url);
}
#endregion #endregion
} }
} }

@ -42,6 +42,13 @@ namespace ViewModels
get => Model.PublishDate; get => Model.PublishDate;
} }
public List<WorkVM> Works
{
get => Model.Works.Select(w => new WorkVM(w)).ToList();
}
public string WorkDescription => Model.Works.Count > 0 ? Model.Works.First().Description : " ";
public List<AuthorVM> Authors public List<AuthorVM> Authors
{ {
get => Model.Authors.Select(a => new AuthorVM(a)).ToList(); get => Model.Authors.Select(a => new AuthorVM(a)).ToList();

@ -0,0 +1,42 @@
using Model;
using PersonalMVVMToolkit;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ViewModels
{
public class WorkVM : BaseViewModel<Work>
{
#region Fields
#endregion
#region Properties
public string Id
{
get => Model.Id;
set => SetProperty(Model.Id, value, v => Model.Id = value);
}
public string Description
{
get => Model.Description;
set => SetProperty(Model.Description, value, v => Model.Description = value);
}
#endregion
#region Constructor
public WorkVM(Work w) : base(w)
{
}
#endregion
}
}
Loading…
Cancel
Save