|
@@ -86,13 +86,14 @@ namespace Avalonia.Controls.Generators
|
|
|
{
|
|
{
|
|
|
if (count > 0)
|
|
if (count > 0)
|
|
|
{
|
|
{
|
|
|
- var toMove = _containers.Where(x => x.Key >= index).ToList();
|
|
|
|
|
|
|
+ var toMove = _containers.Where(x => x.Key >= index)
|
|
|
|
|
+ .OrderByDescending(x => x.Key).ToList();
|
|
|
|
|
|
|
|
foreach (var i in toMove)
|
|
foreach (var i in toMove)
|
|
|
{
|
|
{
|
|
|
_containers.Remove(i.Key);
|
|
_containers.Remove(i.Key);
|
|
|
i.Value.Index += count;
|
|
i.Value.Index += count;
|
|
|
- _containers[i.Value.Index] = i.Value;
|
|
|
|
|
|
|
+ _containers.Add(i.Value.Index, i.Value);
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -116,7 +117,8 @@ namespace Avalonia.Controls.Generators
|
|
|
_containers.Remove(i);
|
|
_containers.Remove(i);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- var toMove = _containers.Where(x => x.Key >= startingIndex).ToList();
|
|
|
|
|
|
|
+ var toMove = _containers.Where(x => x.Key >= startingIndex)
|
|
|
|
|
+ .OrderBy(x => x.Key).ToList();
|
|
|
|
|
|
|
|
foreach (var i in toMove)
|
|
foreach (var i in toMove)
|
|
|
{
|
|
{
|