Skip to content

Commit 606ba21

Browse files
SubhikshaSf4851jfversluis
authored andcommitted
Added snapshots and requested changes
1 parent 285b570 commit 606ba21

File tree

5 files changed

+4
-3
lines changed

5 files changed

+4
-3
lines changed

src/Controls/src/Core/Handlers/Shell/Windows/ShellView.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,16 @@ internal void UpdateMenuItemSource()
122122
{
123123
_flyoutGrouping = newGrouping;
124124
var newItems = IterateItems(newGrouping).ToList();
125+
var itemsCount = FlyoutItems.Count;
125126

126127
for (int index = 0; index < newItems.Count; index++)
127128
{
128129
var item = newItems[index];
129-
var flyoutItemIndex = FlyoutItems.IndexOf(item);
130130

131-
if (flyoutItemIndex == -1)
131+
if (!FlyoutItems.Contains(item))
132132
{
133-
if (index < FlyoutItems.Count)
133+
// Use Insert when within bounds, otherwise Add
134+
if (index < itemsCount)
134135
{
135136
FlyoutItems.Insert(index, item);
136137
}
20.4 KB
Loading
11.6 KB
Loading
8.33 KB
Loading
12.1 KB
Loading

0 commit comments

Comments
 (0)