diff --git a/LivreLand/View/DetailsLivreView.xaml b/LivreLand/View/DetailsLivreView.xaml
index 8d5d128..2e705eb 100644
--- a/LivreLand/View/DetailsLivreView.xaml
+++ b/LivreLand/View/DetailsLivreView.xaml
@@ -102,6 +102,9 @@
+
+
+
@@ -178,7 +181,7 @@
-
diff --git a/LivreLand/ViewModel/DetailsLivreVM.cs b/LivreLand/ViewModel/DetailsLivreVM.cs
index 1465e49..97ae12b 100644
--- a/LivreLand/ViewModel/DetailsLivreVM.cs
+++ b/LivreLand/ViewModel/DetailsLivreVM.cs
@@ -77,6 +77,8 @@ namespace LivreLand.ViewModel
public ICommand RemoveBookCommand { get; private set; }
+ public ICommand OpenInfoCommand { get; private set; }
+
#endregion
#region Constructor
@@ -92,6 +94,7 @@ namespace LivreLand.ViewModel
AddBookToReadListCommand = new RelayCommand((bookVM) => AddBookToReadList(bookVM));
LoanBookCommand = new RelayCommand((bookVM) => LoanBook(bookVM));
RemoveBookCommand = new RelayCommand((bookVM) => RemoveBook(bookVM));
+ OpenInfoCommand = new RelayCommand(() => OpenInfo());
}
#endregion
@@ -167,6 +170,13 @@ namespace LivreLand.ViewModel
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
}
}
diff --git a/ViewModels/BookVM.cs b/ViewModels/BookVM.cs
index 982554c..6f81784 100644
--- a/ViewModels/BookVM.cs
+++ b/ViewModels/BookVM.cs
@@ -42,6 +42,13 @@ namespace ViewModels
get => Model.PublishDate;
}
+ public List Works
+ {
+ get => Model.Works.Select(w => new WorkVM(w)).ToList();
+ }
+
+ public string WorkDescription => Model.Works.Count > 0 ? Model.Works.First().Description : " ";
+
public List Authors
{
get => Model.Authors.Select(a => new AuthorVM(a)).ToList();
diff --git a/ViewModels/WorkVM.cs b/ViewModels/WorkVM.cs
new file mode 100644
index 0000000..a050287
--- /dev/null
+++ b/ViewModels/WorkVM.cs
@@ -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
+ {
+ #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
+ }
+}