Repository navigation
Conversation
ItemCollection's indexer setter (Items[i] = x) replaced the item without raising VectorChanged, so the ItemsControl kept showing the old item in its container. It now raises ItemChanged, carrying the old and new items like a replacement in an ItemsSource. Co-Authored-By: Claude Opus 5.5 <[email protected]>
2 of 5 tasks
Contributor
|
🤖 Your WebAssembly Sample App stage site is ready! Visit it here: |
Contributor
|
The build 245690 found UI Test snapshots differences: Details
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GitHub Issue: none (found while porting
ListBox, #26321)PR Type:
🐞 Bugfix
What changed? 🚀
ItemCollection's indexer setter (Items[i] = x) replaced the item without raisingVectorChanged. NoItemsControlsaw the replacement: the container kept showing the old item, andContainerFromItemstill found it.The setter now raises
ItemChanged. Like a replacement in anItemsSource, the event carries the old and new items, so theItemsControl's collection-change handling knows what was replaced.Validation
Given_ItemsControl.When_Items_Indexer_Set_Then_Container_Updated, for a plainItemsControland aListView: it fails without the fix and passes with it on Skia desktop. It also passes on native WinUI.Given_ItemsControl,Given_ListViewBase,Given_ListViewBase_Items,Given_ComboBox,Given_FlipView,Given_Selector: 238 passed, 0 failed, 16 skipped, 1 inconclusive (When_Large_List_Scroll_To_End_Then_Back_Up_TryClick, also inconclusive without this change).Given_Pivot,Given_TabView,Given_GridView_Items,Given_AutoSuggestBox,Given_ListBox,Given_ItemsStackPanel: 42 passed, 0 failed, 3 skipped. TheItems.VectorChangedsubscribers andOnItemsChangedoverrides (AutoSuggestBox,ComboBox,FlipView,TabViewListView,Pivot's presenter,Selector) already getItemChangedfrom a replacement in anItemsSource; none of them throws on it.PR Checklist ✅
Screenshots Compare Test Runresults.🤖 Generated with Claude Code