public void MoveInFrontOf(PNode sibling) { PNode p = parent; if (p != null && p == sibling.Parent) { p.RemoveChild(this); int index = p.IndexOfChild(sibling); p.AddChild(index + 1, this); } }