public static void BringSubviewToFront(this NSView superView, NSView theView) { if(theView == null || !superView.Subviews.Contains(theView)) return; theView.RemoveFromSuperview(); superView.AddSubview(theView); }
public static void ReplaceChild(NSView cont, NSView oldView, NSView newView) { if (cont is IViewContainer) { ((IViewContainer)cont).ReplaceChild (oldView, newView); } else if (cont is NSView) { newView.Frame = oldView.Frame; oldView.RemoveFromSuperview (); newView.AddSubview (newView); } }