protected virtual void SetVisibleCore(bool value) {
if (value != is_visible) {
is_visible = value;
if (is_visible && ((window.Handle == IntPtr.Zero) || !is_created))
CreateControl ();
if (IsHandleCreated) {
XplatUI.SetVisible (Handle, is_visible, true);
if (is_visible && this is Form) {
// If we are Min or Max, we won't get a WM_SHOWWINDOW from SetWindowState,
// so we need to manually create our children, and set them visible
// (This normally happens in WmShowWindow.)
if ((this as Form).WindowState != FormWindowState.Normal)
OnVisibleChanged (EventArgs.Empty);
else
XplatUI.SetWindowPos(window.Handle, bounds.X, bounds.Y, bounds.Width, bounds.Height);
}
}
else {
OnVisibleChanged(EventArgs.Empty);
}
}
}