ListViewEventArgs.cs 1.3 KB

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