public override void RenderAfter(RenderContext renderContext)
{
base.RenderAfter(renderContext);
// Convert our rectangle to the screen
Rectangle screenRect = renderContext.TopControl.RectangleToScreen(renderContext.TopControl.ClientRectangle);
// If the fixed rectangle is in our showing area and at the top
if ((screenRect.Contains(_fixedScreenRect)) && (screenRect.Y == _fixedScreenRect.Y))
{
// Position the element appropriately
using (ViewLayoutContext layoutContext = new ViewLayoutContext(renderContext.Control, renderContext.Renderer))
{
layoutContext.DisplayRectangle = renderContext.TopControl.RectangleToClient(_fixedScreenRect);
_fixedElement.Layout(layoutContext);
}
// Now draw
_fixedElement.Render(renderContext);
}
}