ListBox
Description
Use ListBox for compact selection lists; set SelectionMode to Extended to allow selecting multiple items.
Example usage
- XAML
- C#
<fluence:ListBox SelectionMode="Extended">
<fluence:ListBoxItem Content="Documents" />
<fluence:ListBoxItem Content="Pictures" />
</fluence:ListBox>
var list = new Fluence.Wpf.Controls.ListBox();
list.Items.Add("First");
Key properties
| Property | Default | Purpose |
|---|---|---|
ItemsSource | null (WPF default) | Collection shown in the list. |
SelectionMode | Single (WPF default) | Controls single or multiple selection. |
CornerRadius | 4 | Rounds the list surface. |
State and behavior
SelectionMode controls single or extended selection; selected items receive a distinct state.
Parts
ListBoxItem
Description
ListBoxItem is the visible selectable container inside ListBox. The screenshots show ListBoxItem inside ListBox.
Use it as an item container within a ListBox.
The parent control capture above shows this part in context.
Example usage
<fluence:ListBox>
<fluence:ListBoxItem Content="Documents" IsSelected="True" />
<fluence:ListBoxItem Content="Pictures" />
</fluence:ListBox>
State and behavior
The item container shows selection, pointer, focus, and disabled states within ListBox.
Reference
Events
The inherited SelectionChanged event reports a changed selection.