SelectedItemChangedArgs.cs 866 B

123456789101112131415161718192021
  1. #nullable enable
  2. namespace Terminal.Gui.Views;
  3. /// <summary>Event arguments for the SelectedItemChanged event.</summary>
  4. public class SelectedItemChangedArgs : EventArgs
  5. {
  6. /// <summary>Initializes a new <see cref="SelectedItemChangedArgs"/> class.</summary>
  7. /// <param name="selectedItem"></param>
  8. /// <param name="previousSelectedItem"></param>
  9. public SelectedItemChangedArgs (int? selectedItem, int? previousSelectedItem)
  10. {
  11. PreviousSelectedItem = previousSelectedItem;
  12. SelectedItem = selectedItem;
  13. }
  14. /// <summary>Gets the index of the item that was previously selected. null if there was no previous selection.</summary>
  15. public int? PreviousSelectedItem { get; }
  16. /// <summary>Gets the index of the item that is now selected. null if there is no selection.</summary>
  17. public int? SelectedItem { get; }
  18. }