Revert: only call notifyPropertyChanged if actually set to new value
This commit is contained in:
parent
9bdcaa5eaa
commit
28a8b2e685
@ -135,14 +135,11 @@ namespace LibationWinForms.Dialogs
|
|||||||
return _remove;
|
return _remove;
|
||||||
}
|
}
|
||||||
set
|
set
|
||||||
{
|
|
||||||
if (_remove != value)
|
|
||||||
{
|
{
|
||||||
_remove = value;
|
_remove = value;
|
||||||
NotifyPropertyChanged();
|
NotifyPropertyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public override object GetMemberValue(string memberName)
|
public override object GetMemberValue(string memberName)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -40,14 +40,11 @@ namespace LibationWinForms
|
|||||||
{
|
{
|
||||||
get => _cover;
|
get => _cover;
|
||||||
private set
|
private set
|
||||||
{
|
|
||||||
if (_cover != value)
|
|
||||||
{
|
{
|
||||||
_cover = value;
|
_cover = value;
|
||||||
NotifyPropertyChanged();
|
NotifyPropertyChanged();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public bool DownloadInProgress { get; private set; }
|
public bool DownloadInProgress { get; private set; }
|
||||||
public string ProductRating { get; private set; }
|
public string ProductRating { get; private set; }
|
||||||
@ -175,25 +172,16 @@ namespace LibationWinForms
|
|||||||
switch (itemName)
|
switch (itemName)
|
||||||
{
|
{
|
||||||
case nameof(udi.Tags):
|
case nameof(udi.Tags):
|
||||||
if (Book.UserDefinedItem.Tags != udi.Tags)
|
|
||||||
{
|
|
||||||
Book.UserDefinedItem.Tags = udi.Tags;
|
Book.UserDefinedItem.Tags = udi.Tags;
|
||||||
NotifyPropertyChanged(nameof(DisplayTags));
|
NotifyPropertyChanged(nameof(DisplayTags));
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case nameof(udi.BookStatus):
|
case nameof(udi.BookStatus):
|
||||||
if (Book.UserDefinedItem.BookStatus != udi.BookStatus)
|
|
||||||
{
|
|
||||||
Book.UserDefinedItem.BookStatus = udi.BookStatus;
|
Book.UserDefinedItem.BookStatus = udi.BookStatus;
|
||||||
NotifyPropertyChanged(nameof(Liberate));
|
NotifyPropertyChanged(nameof(Liberate));
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case nameof(udi.PdfStatus):
|
case nameof(udi.PdfStatus):
|
||||||
if (Book.UserDefinedItem.PdfStatus != udi.PdfStatus)
|
|
||||||
{
|
|
||||||
Book.UserDefinedItem.PdfStatus = udi.PdfStatus;
|
Book.UserDefinedItem.PdfStatus = udi.PdfStatus;
|
||||||
NotifyPropertyChanged(nameof(Liberate));
|
NotifyPropertyChanged(nameof(Liberate));
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -223,23 +211,9 @@ namespace LibationWinForms
|
|||||||
|
|
||||||
private void UpdateLiberatedStatus(bool notify = true)
|
private void UpdateLiberatedStatus(bool notify = true)
|
||||||
{
|
{
|
||||||
var changed = false;
|
_bookStatus = LibraryCommands.Liberated_Status(LibraryBook.Book);
|
||||||
|
_pdfStatus = LibraryCommands.Pdf_Status(LibraryBook.Book);
|
||||||
var newBookStatus = LibraryCommands.Liberated_Status(LibraryBook.Book);
|
if (notify)
|
||||||
if (_bookStatus != newBookStatus)
|
|
||||||
{
|
|
||||||
_bookStatus = newBookStatus;
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
var newPdfStatus = LibraryCommands.Pdf_Status(LibraryBook.Book);
|
|
||||||
if (_pdfStatus != newPdfStatus)
|
|
||||||
{
|
|
||||||
_pdfStatus = newPdfStatus;
|
|
||||||
changed = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (changed && notify)
|
|
||||||
NotifyPropertyChanged(nameof(Liberate));
|
NotifyPropertyChanged(nameof(Liberate));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user