mirror of
https://github.com/rmcrackan/Libation.git
synced 2026-09-12 21:57:19 -04:00
Both halves of the Add notification were wrong. The index was read after the range had been added, so it pointed past the end by the size of the batch - queueing two books into a list of four announced them at index 6. And the parameter is IList<T>, which does not implement the non-generic IList, so the compiler bound the changedItem overload and the event named the list object itself as the single item added rather than the books in it. Both UIs survived it: WinForms discards the event and re-reads, and Avalonia evidently falls back to re-reading too. But this class exists to give an index-based consumer something it can follow, and this was the one notification it could not. The list is also copied now, so the event does not hand out a reference the caller can still mutate. Co-authored-by: rmcrackan <rmcrackan@gmail.com>