public void WillShow(NSNotification notification) { if (parent != notification.Object) { return; } ChildBackend.SetAutosizeMode(true); Child.Surface.Reallocate(); if (BackgroundColor != null) { if (View.Window.ContentView.Superview.Layer == null) { View.Window.ContentView.Superview.WantsLayer = true; } View.Window.ContentView.Superview.Layer.BackgroundColor = BackgroundColor; } WidgetSpacing padding = 0; if (Backend != null) { padding = Backend.Frontend.Padding; } NativeChild.SetFrameOrigin(new CGPoint((nfloat)padding.Left, (nfloat)padding.Top)); shown = true; }
void RemoveChild() { if (Child != null) { NativeChild.RemoveFromSuperview(); NativeChild.SetFrameOrigin(new CGPoint(0, 0)); ChildBackend.SetAutosizeMode(false); Child = null; ChildBackend = null; } }