ItemRange.cs 586 B

12345678910111213141516171819202122232425
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace GeekDesk.CustomComponent.VirtualizingWrapPanel
  7. {
  8. public struct ItemRange
  9. {
  10. public int StartIndex { get; }
  11. public int EndIndex { get; }
  12. public ItemRange(int startIndex, int endIndex) : this()
  13. {
  14. StartIndex = startIndex;
  15. EndIndex = endIndex;
  16. }
  17. public bool Contains(int itemIndex)
  18. {
  19. return itemIndex >= StartIndex && itemIndex <= EndIndex;
  20. }
  21. }
  22. }