namespace Terminal.Gui; /// Collection navigator for cycling selections in a . public class TableCollectionNavigator : CollectionNavigatorBase { private readonly TableView tableView; /// Creates a new instance for navigating the data in the wrapped . public TableCollectionNavigator (TableView tableView) { this.tableView = tableView; } /// protected override object ElementAt (int idx) { int col = tableView.SelectedColumn; object rawValue = tableView.Table [idx, col]; ColumnStyle style = tableView.Style.GetColumnStyleIfAny (col); return style?.RepresentationGetter?.Invoke (rawValue) ?? rawValue; } /// protected override int GetCollectionLength () { return tableView.Table.Rows; } }