namespace Terminal.Gui {
///
/// Collection navigator for cycling selections in a .
///
public class TableCollectionNavigator : CollectionNavigatorBase {
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)
{
var col = tableView.SelectedColumn;
var rawValue = tableView.Table [idx, col];
var style = this.tableView.Style.GetColumnStyleIfAny (col);
return style?.RepresentationGetter?.Invoke (rawValue) ?? rawValue;
}
///
protected override int GetCollectionLength ()
{
return tableView.Table.Rows;
}
}
}