Skip to content

Commit

Permalink
feat: Support for UIElementCollection.Move on Skia
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinZikmund committed Apr 5, 2024
1 parent c9c6488 commit cd661d4
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/Uno.UI/UI/Xaml/UIElement.skia.cs
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,19 @@ internal void AddChild(UIElement child, int? index = null)

internal void MoveChildTo(int oldIndex, int newIndex)
{
ApiInformation.TryRaiseNotImplemented("UIElement", "MoveChildTo");
var view = _children[oldIndex];

_children.RemoveAt(oldIndex);
if (newIndex == _children.Count)
{
_children.Add(view);
}
else
{
_children.Insert(newIndex, view);
}

InvalidateMeasure();
}

internal bool RemoveChild(UIElement child)
Expand Down

0 comments on commit cd661d4

Please sign in to comment.