Improve classic and chardonnay rating editor simmilarity

This commit is contained in:
Michael Bucari-Tovo 2022-12-31 10:02:30 -07:00
parent c9497ef39e
commit 874bf9e7c0
14 changed files with 233 additions and 178 deletions

View file

@ -65,7 +65,9 @@ namespace LibationAvalonia.ViewModels
Title = Book.Title;
Series = Book.SeriesNames();
Length = Book.LengthInMinutes == 0 ? "" : $"{Book.LengthInMinutes / 60} hr {Book.LengthInMinutes % 60} min";
_myRating = Book.UserDefinedItem.Rating;
//Ratings are changed using Update(), which is a problem for Avalonia data bindings because
//the reference doesn't change. Clone the rating so that it updates within Avalonia properly.
_myRating = new Rating(Book.UserDefinedItem.Rating.OverallRating, Book.UserDefinedItem.Rating.PerformanceRating, Book.UserDefinedItem.Rating.StoryRating);
PurchaseDate = libraryBook.DateAdded.ToString("d");
ProductRating = Book.Rating?.ToStarString()?.DefaultIfNullOrWhiteSpace("");
Authors = Book.AuthorNames();