/// <summary> /// Calculate the client area where the content can be drawed, usually removing the area used by the background, for example removing a border. /// </summary> /// <param name="graphics"></param> /// <param name="backGroundArea"></param> /// <returns></returns> public RectangleF GetContentRectangle(MeasureHelper measure, RectangleF backGroundArea) { if (Border != null) { backGroundArea = Border.GetContentRectangle(backGroundArea); } if (Padding.IsEmpty == false) { backGroundArea = Padding.GetContentRectangle(backGroundArea); } if (Background is IBackground) { backGroundArea = ((IBackground)Background).GetBackgroundContentRectangle(measure, backGroundArea); } return(backGroundArea); }