/// <summary> /// Raises the Paint event. /// </summary> /// <param name="e">A PaintEventArgs that contains the event data.</param> protected override void OnPaint(PaintEventArgs e) { // Cannot process a message for a disposed control if (!IsDisposed) { // Do we have a manager to use for painting? if (ViewManager != null) { // If the layout is dirty, or the size of the control has changed // without a layout being performed, then perform a layout now if (_layoutDirty && (!Size.Equals(_lastLayoutSize))) { PerformLayout(); } // Draw the background as transparent, by drawing parent PaintTransparentBackground(e); // Ask the view to repaint the visual structure ViewManager.Paint(_renderer, e); // Request for a refresh has been serviced _refresh = false; _refreshAll = false; } } }
/// <summary> /// Raises the Paint event. /// </summary> /// <param name="e">A PaintEventArgs that contains the event data.</param> protected override void OnPaint(PaintEventArgs e) { // Cannot process a message for a disposed control if (!IsDisposed && !Disposing) { // Do we have a manager to use for painting? if (ViewManager != null) { // If the layout is dirty, then perform a layout now if (_layoutDirty) { Size beforeSize = ClientSize; PerformLayout(); // Did the layout cause a change in the size of the control? if ((beforeSize.Width < ClientSize.Width) || (beforeSize.Height < ClientSize.Height)) { // Have to reset the _refresh before calling need paint otherwise // it will not create another invalidate or invoke call as necessary _refresh = false; _refreshAll = false; PerformNeedPaint(false); } } // Draw the background as transparent, by drawing parent PaintTransparentBackground(e); // Ask the view to repaint the visual structure if (!IsDisposed && !Disposing) { ViewManager.Paint(_renderer, e); } // Request for a refresh has been serviced _refresh = false; _refreshAll = false; } } }