Browse Source

Bump collection change event priority.

Post collection changes to UI thread with higher priority than `Layout` so that all collection changes are processed before the next layout pass.

`VirtualizingStackPanel` maintains its own mapping of Items -> Containers, and updates that mapping when a `CollectionChanged` event is received, but it also expects that mapping to be up-to-date when a layout is performed.

Fixes #10399
pull/10462/head
Steven Kirk 3 years ago
parent
commit
1cd80712e9
  1. 2
      src/Avalonia.Controls/Utils/CollectionChangedEventManager.cs

2
src/Avalonia.Controls/Utils/CollectionChangedEventManager.cs

@ -141,7 +141,7 @@ namespace Avalonia.Controls.Utils
else
{
var eCapture = e;
Dispatcher.UIThread.Post(() => Notify(_collection, eCapture, l));
Dispatcher.UIThread.Post(() => Notify(_collection, eCapture, l), DispatcherPriority.Send);
}
}
}

Loading…
Cancel
Save