Table of Contents

Constructor EnumerableTableSource

Namespace
Terminal.Gui
Assembly
Terminal.Gui.dll

EnumerableTableSource(IEnumerable<T>, Dictionary<string, Func<T, object>>)

Creates a new instance of the class that presents data collection as a table.

public EnumerableTableSource(IEnumerable<T> data, Dictionary<string, Func<T, object>> columnDefinitions)

Parameters

data IEnumerable<T>

The data that you want to present. The members of this collection will be frozen after construction.

columnDefinitions Dictionary<string, Func<T, object>>

Getter methods for each property you want to present in the table. For example:

 new () {
    { "Colname1", (t)=>t.SomeField},
    { "Colname2", (t)=>t.SomeOtherField}
}

Remarks

The elements of the data collection are recorded during construction (immutable) but the properties of those objects are permitted to change.