Lazy-loading collection now only increases its version when the total item count changes
This commit is contained in:
parent
246c90f7c8
commit
b44b2b406b
@ -811,12 +811,14 @@ namespace Nuclex.Avalonia.Collections {
|
|||||||
if(fetchedItemCount < this.pageSize) {
|
if(fetchedItemCount < this.pageSize) {
|
||||||
itemCount = offset + fetchedItemCount;
|
itemCount = offset + fetchedItemCount;
|
||||||
lock(this) {
|
lock(this) {
|
||||||
|
if(itemCount < this.assumedCount) {
|
||||||
this.assumedCount = itemCount;
|
this.assumedCount = itemCount;
|
||||||
}
|
|
||||||
#if DEBUG
|
#if DEBUG
|
||||||
++this.version;
|
++this.version;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// The count may have been adjusted if this truncated the list,
|
// The count may have been adjusted if this truncated the list,
|
||||||
// so recalculate the actual number of items. Then send out change
|
// so recalculate the actual number of items. Then send out change
|
||||||
|
Loading…
Reference in New Issue
Block a user