Fix selection when updating an item that moves to a new pos

This commit is contained in:
TheXamlGuy
2024-05-29 21:23:49 +01:00
parent a777649d14
commit b17c216f2b
@@ -437,25 +437,9 @@ public partial class ObservableCollection<TItem> :
TItem item = this[oldIndex];
bool selected = false;
if (item is ISelectable selectable)
{
selected = selectable.Selected;
SelectedItem = default;
}
RemoveItem(oldIndex);
Insert(newIndex, item);
if (selected)
{
SelectedItem = item;
if (item is ISelectable selectable2)
{
selectable2.Selected = true;
}
}
return true;
}