UWP C# Moving PivotItem to different index

1

I have this Pivot control, loaded with PivotItems. It's all good except that I want to be able to dynamically reorder the PivotItems, without cloning the PivotItems.

The problem is that the ItemCollection of the Pivot control does not seem to be able to do that. I can insert a different PivotItem, but not one that already exists at a different index (System.ArgumentException: Value does not fall within the expected range).

I also tried myPivot.Items.RemoveAt(currentIndex) followed by myPivot.Items.Insert(targetIndex, tabToMove) but this sometimes produces System.Runtime.InteropServices.COMException (0x800F1000): No installed components were detected. Element is already the child of another element.

Ideas?

c#
uwp
pivotitem
itemcollection
asked on Stack Overflow Aug 2, 2018 by Jean-Marc

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0