public override void Draw(SpriteBatch sb, DrawComponents drawComponents) { if (!Visible) { return; } if (IsDirty) { Recalculate(); } // draw background sb.Draw(Pixel.ListBackground, CleanRect, Color.White); // draw border sb.Draw(_spriteSheet, _destRectTop, Ui.Border.Top, Color.White); sb.Draw(_spriteSheet, _destRectLeft, Ui.Border.Left, Color.White); sb.Draw(_spriteSheet, _destRectRight, Ui.Border.Right, Color.White); sb.Draw(_spriteSheet, _destRectBottom, Ui.Border.Bottom, Color.White); // draw items for (int i = VerticalScrollIndex; i < _items.Count && i - VerticalScrollIndex < VerticalMaxVisibleItems; i++) { _items[i].Draw(sb, drawComponents, _selectedItem?.Value.Equals(_items[i].Value) ?? false); } if (VerticalItemCount > VerticalMaxVisibleItems) { _scrollBar.Draw(sb, drawComponents); } }