protected override void OnSizeRequested(ref Requisition requisition) { // make request to root if (root != null && root.Visible) { requisition = root.SizeRequest(); } else { requisition.Width = requisition.Height = 0; } requisition.Width += 2 * (int)BorderWidth; requisition.Height += 2 * (int)BorderWidth; }