/// <summary> /// Moves a view from one position to another position, without unloading it. /// </summary> /// <param name="oldIndex">The old index of the item</param> /// <param name="newIndex">The new index of the item</param> /// <remarks> /// TBD /// </remarks> internal void MoveViewTo(int oldIndex, int newIndex) { var view = _shadowChildren[oldIndex]; _shadowChildren.RemoveAt(oldIndex); _shadowChildren.Insert(newIndex, view); var reorderIndex = Math.Min(oldIndex, newIndex); for (int i = reorderIndex; i < _shadowChildren.Count; i++) { // TODO: Use AddSubview with foremost // BringSubviewToFront(newShadow[i]); } }
/// <summary> /// Adds a view to the current view group using a position index. /// </summary> /// <remarks>This method does not call the actual AddView method, /// but an optimized version of it that does not require a hierarchy /// observer.</remarks> public new virtual void AddView(View view, int index) { _childrenShadow.Insert(index, view); base.AddViewFast(view, index); OnChildViewAdded(view); }
public override void InsertSubview(UIView view, nint atIndex) { // cf. AddSubview comment! _shadowChildren.Insert((int)atIndex, view); base.InsertSubview(view, atIndex); }