In AvaloniaUI, there are two ways to handle selected items in a
ListBox, each corresponding to a
different property on the control:
Selection. The AvaloniaUI team recommends against the use of
SelectedItems for large collection, so I started using the
Selection property instead.
I needed to support multi-selection, so I set the
SelectionMode property to
Multiple, created a
my ViewModel, added the
Items, and started the application. Unfortunately, the ListBox did not allow multiple
I found a boolean property on the
SingleSelect. Once I set this property
false, I was able to select multiple items in the ListBox.