Fix libation hanging on first inport of large libraries
This commit is contained in:
parent
0af7c4d90a
commit
bfcd226795
@ -164,6 +164,10 @@ namespace LibationAvalonia.ViewModels
|
|||||||
if (GridEntries == null)
|
if (GridEntries == null)
|
||||||
throw new InvalidOperationException($"Must call {nameof(BindToGridAsync)} before calling {nameof(UpdateGridAsync)}");
|
throw new InvalidOperationException($"Must call {nameof(BindToGridAsync)} before calling {nameof(UpdateGridAsync)}");
|
||||||
|
|
||||||
|
//CollectionChanged fires for every book added, and the handler invokes
|
||||||
|
//VisibleCountChanged which triggers Libation to re-count all books.
|
||||||
|
GridEntries.CollectionChanged -= GridEntries_CollectionChanged;
|
||||||
|
|
||||||
#region Add new or update existing grid entries
|
#region Add new or update existing grid entries
|
||||||
|
|
||||||
//Add absent entries to grid, or update existing entry
|
//Add absent entries to grid, or update existing entry
|
||||||
@ -214,7 +218,7 @@ namespace LibationAvalonia.ViewModels
|
|||||||
await Filter(FilterString);
|
await Filter(FilterString);
|
||||||
GC.Collect(GC.MaxGeneration, GCCollectionMode.Aggressive, true, true);
|
GC.Collect(GC.MaxGeneration, GCCollectionMode.Aggressive, true, true);
|
||||||
|
|
||||||
if (GridEntries != null)
|
//Resubscribe after all changes to the list have been made
|
||||||
GridEntries.CollectionChanged += GridEntries_CollectionChanged;
|
GridEntries.CollectionChanged += GridEntries_CollectionChanged;
|
||||||
GridEntries_CollectionChanged();
|
GridEntries_CollectionChanged();
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user