Repository navigation
Lists
realonepiecefreak edited this page Oct 6, 2024
·
5 revisions
A scrollable list of components, which can optionally be selected.

To create a list of labels:
var list = new List<Label>
{
Items =
{
new Label("Label 1"),
new Label("Label 2")
}
}
-
Items: The items to render -
SelectedItem: The currently selected item, ornull; Does not invoke theSelectedItemChangedevent -
Alignment: If the items are displayed vertically and horizontally -
Size: The size of the list -
ItemSpacing: The spacing between the items -
Padding: The padding between the list border and items -
ScrollToLastItem: If the list should scroll to the last item in the list after adding a new item -
IsSelectable: If items can be selected
-
SelectedItemChanged: For when theSelectedItemwas changed
A table of data columns and rows, for a uniform view on a list of entries.

Create a data table with column headers:
var table = new DataTable<int>
{
// Defines the columns, their headers, and how to get the value from each data entry
Columns =
{
new DataTableColumn<int>(i => $"{i}", "Value")
},
// Adds the actual data entries
Rows =
{
new DataTableRow<int>(0)
}
};
-
Size: the size of the table -
ContextMenu: A ContextMenu, when a data entry is right-clicked -
Columns: The column header and value getter definitions -
Rows: The data entries in the table -
SelectedRows: Gets the currently selected data entries -
IsResizable: If the column headers are resizable -
IsSelectable: If data entries can be selected -
ShowHeaders: If the column headers should be rendered -
CanSelectMultiple: If multiple data entries can be selected at the same time; Hold Ctrl while left-clicking entries
-
SelectedRowsChanged: For when the selected data entries were changed -
DoubleClicked: For when a data entry was double clicked