OptionList<T> is a single-choice list widget optimized for keyboard/mouse selection.
new OptionList<string>()
.Items(["First", "Second"]);
OptionList<T> is single-selection (SelectedIndex) and can raise activation events.
Keyboard:
Up / Down, PageUp / PageDown, Home / End: navigate the selectionEnter / Space: activate the selected itemItemSearchText)Mouse:
ActivateOnClick is enabled.Use ItemIsEnabled to disable certain rows (they remain visible but cannot be selected/activated):
new OptionList<string>()
.Items(["Open", "Save", "Exit"])
.ItemIsEnabled(item => item != "Save");
Like other list controls, OptionList<T> uses DataTemplate<T> to render items.
If you don’t set ItemTemplate, the template is resolved from the environment (DataTemplates).
HorizontalAlignment = Align.Start, VerticalAlignment = Align.StartOptionListStyle controls marker glyphs, spacing, hover/selection styles, and layout details.