Class ColumnBuilder<TObject, TItem>
Class that describes a data selector for generating a data column within a table.
Implements
Inherited Members
Namespace: TheXDS.MCART.Types
Assembly: MCART.Wpf.FlowDocumentExtensions.dll
Syntax
public class ColumnBuilder<TObject, TItem> : IColumnBuilder<TObject>
Type Parameters
| Name | Description |
|---|---|
| TObject | Type of object from which the column information will be extracted. |
| TItem | Type of item to return for this column. |
Constructors
| Edit this page View SourceColumnBuilder(string, Func<TObject, TItem>)
Class that describes a data selector for generating a data column within a table.
Declaration
public ColumnBuilder(string header, Func<TObject, TItem> selector)
Parameters
| Type | Name | Description |
|---|---|---|
| string | header | Title of the column. |
| Func<TObject, TItem> | selector | Data selection function. |
Properties
| Edit this page View SourceHeader
Title of the column.
Declaration
public string Header { get; }
Property Value
| Type | Description |
|---|---|
| string |
Selector
Data selection function.
Declaration
public Func<TObject, TItem> Selector { get; }
Property Value
| Type | Description |
|---|---|
| Func<TObject, TItem> |
Styles
Gets a collection of styles registered for this column.
Declaration
public IList<CellStyle<TItem>> Styles { get; }
Property Value
| Type | Description |
|---|---|
| IList<CellStyle<TItem>> |
Methods
| Edit this page View SourceContent(TObject)
Content of the current row to be set in this column.
Declaration
public string Content(TObject obj)
Parameters
| Type | Name | Description |
|---|---|---|
| TObject | obj | Object from which to extract the content. |
Returns
| Type | Description |
|---|---|
| string | The content in string format to place within the cell corresponding to this column in the current row. |
CurrentStyle(TItem)
Gets a style to be used for the current item.
Declaration
public CellStyle<TItem>? CurrentStyle(TItem currentItem)
Parameters
| Type | Name | Description |
|---|---|---|
| TItem | currentItem | Value against which to evaluate the styles. |
Returns
| Type | Description |
|---|---|
| CellStyle<TItem> | A style that can be applied to the value, or null if no style can be applied. |
Style(object?)
Gets a style to be used on the cell in this column of the current row.
Declaration
public ICellStyle? Style(object? item)
Parameters
| Type | Name | Description |
|---|---|---|
| object | item |
Returns
| Type | Description |
|---|---|
| ICellStyle | A style to apply to the generated cell, or null if a valid style cannot be obtained. |