#nullable disable
namespace Terminal.Gui.Views;
/// Collection navigator for cycling selections in a .
internal 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.FullRowSelect ? 0 : _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; }
}