Preserve "expanded" status when updating library

This commit is contained in:
MBucari 2023-03-17 17:47:27 -06:00
parent fd16e97632
commit 56de1e7659

View File

@ -34,6 +34,7 @@ namespace LibationUiBase.GridView
#region Model properties exposed to the view
protected bool? remove = false;
private EntryStatus _liberate;
private string _purchasedate;
private string _length;
private LastDownloadStatus _lastDownload;
@ -50,7 +51,7 @@ namespace LibationUiBase.GridView
private Rating _myRating;
public abstract bool? Remove { get; set; }
public EntryStatus Liberate { get; private set; }
public EntryStatus Liberate { get => _liberate; private set => RaiseAndSetIfChanged(ref _liberate, value); }
public string PurchaseDate { get => _purchasedate; protected set => RaiseAndSetIfChanged(ref _purchasedate, value); }
public string Length { get => _length; protected set => RaiseAndSetIfChanged(ref _length, value); }
public LastDownloadStatus LastDownload { get => _lastDownload; protected set => RaiseAndSetIfChanged(ref _lastDownload, value); }
@ -98,7 +99,10 @@ namespace LibationUiBase.GridView
LibraryBook = libraryBook;
var expanded = Liberate?.Expanded ?? false;
Liberate = TStatus.Create(libraryBook);
Liberate.Expanded = expanded;
Title = Book.Title;
Series = Book.SeriesNames();
Length = GetBookLengthString();