From cd661d4ecb55711cd2d3bba041a3c4a1887e92fc Mon Sep 17 00:00:00 2001 From: Martin Zikmund Date: Mon, 1 Apr 2024 17:57:05 +0200 Subject: [PATCH] feat: Support for UIElementCollection.Move on Skia --- src/Uno.UI/UI/Xaml/UIElement.skia.cs | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/Uno.UI/UI/Xaml/UIElement.skia.cs b/src/Uno.UI/UI/Xaml/UIElement.skia.cs index 0af9d71f21c0..e96786f06048 100644 --- a/src/Uno.UI/UI/Xaml/UIElement.skia.cs +++ b/src/Uno.UI/UI/Xaml/UIElement.skia.cs @@ -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)