Nested ObservableCollection crashes when removing item
Describe the bug
When removing an item in a nested ObservableCollection, tha app crashes with System.ArgumentOutOfRangeException: 'This collection cannot work with indices larger than Int32.MaxValue - 1 (0x7FFFFFFF - 1). (Parameter 'index')'
I attached a small example that reproduces the bug Example.zip
the example consists of 2 ItemsView, one represents the headers and the second represents the details of the selected header.
Steps to reproduce the bug
- Click on Add Header
- Select Header 0
- Click on Add Detail
- Click on Add Detail again
- Select Detail 1
- Click on Remove Detail
- Select Detail 0
- Click on Remove Detail
- App crashes
https://github.com/user-attachments/assets/e4df17e2-9260-4336-bfb6-1a04c1cd54e8
Expected behavior
App does not crash when an item is removed
Screenshots
No response
NuGet package version
WinUI 3 - Windows App SDK 1.5.5: 1.5.240627000
Windows version
Windows 11 (22H2): Build 22621, Windows 10 (20H2): Build 19042
Additional context
No response
This was closed as duplicate of an active internal bug. Reactivating and connecting to that bug.
it also in 1.7-preview1,reproduce: click button1 add item1, click button2 to add item2 and remove item1 in code, will crash.