private TD.Image DrawGrid() { // Skip drawing if viewport not sized yet if (_viewport.GetImageSize().IsEmpty()) { return(null); } // Create image var image = new TD.Image(_viewport); // Update drawer items: pos, visibility,.. (according to collected update flags) #if USE_PERF _perfUpdateItems.Start(); #endif _gridDrawer.UpdateItems(); _gridDrawer.UpdateCursorItem(); #if USE_PERF _perfUpdateItems.Stop(); #endif // Draw items as image elements #if USE_PERF _perfDrawItems.Start(); #endif _gridDrawer.DrawGrid(image); #if USE_PERF _perfDrawItems.Stop(); #endif return(image); }