ListViewEventArgs.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334
  1. namespace Terminal.Gui;
  2. /// <summary><see cref="EventArgs"/> for <see cref="ListView"/> events.</summary>
  3. public class ListViewItemEventArgs : EventArgs
  4. {
  5. /// <summary>Initializes a new instance of <see cref="ListViewItemEventArgs"/></summary>
  6. /// <param name="item">The index of the <see cref="ListView"/> item.</param>
  7. /// <param name="value">The <see cref="ListView"/> item</param>
  8. public ListViewItemEventArgs (int item, object value)
  9. {
  10. Item = item;
  11. Value = value;
  12. }
  13. /// <summary>The index of the <see cref="ListView"/> item.</summary>
  14. public int Item { get; }
  15. /// <summary>The <see cref="ListView"/> item.</summary>
  16. public object Value { get; }
  17. }
  18. /// <summary><see cref="EventArgs"/> used by the <see cref="ListView.RowRender"/> event.</summary>
  19. public class ListViewRowEventArgs : EventArgs
  20. {
  21. /// <summary>Initializes with the current row.</summary>
  22. /// <param name="row"></param>
  23. public ListViewRowEventArgs (int row) { Row = row; }
  24. /// <summary>The current row being rendered.</summary>
  25. public int Row { get; }
  26. /// <summary>The <see cref="Attribute"/> used by current row or null to maintain the current attribute.</summary>
  27. public Attribute? RowAttribute { get; set; }
  28. }