Browse Source

fix derived list/extensions for moverange

pull/2060/head
Andrey Kunchev 7 years ago
parent
commit
aa21fe9d17
  1. 7
      src/Avalonia.Base/Collections/AvaloniaListExtensions.cs

7
src/Avalonia.Base/Collections/AvaloniaListExtensions.cs

@ -104,7 +104,12 @@ namespace Avalonia.Collections
case NotifyCollectionChangedAction.Move:
case NotifyCollectionChangedAction.Replace:
Remove(e.OldStartingIndex, e.OldItems);
Add(e.NewStartingIndex, e.NewItems);
int newIndex = e.NewStartingIndex;
if(newIndex > e.OldStartingIndex)
{
newIndex -= e.OldItems.Count;
}
Add(newIndex, e.NewItems);
break;
case NotifyCollectionChangedAction.Remove:

Loading…
Cancel
Save