AvaloniaUI / Avalonia

Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET UI client technology
https://avaloniaui.net
MIT License
24.52k stars 2.12k forks source link

[FEATURE] ComboBox support for multiple selection mode (Dropdown/Select) #15973

Open LazaroOnline opened 3 weeks ago

LazaroOnline commented 3 weeks ago

Is your feature request related to a problem? Please describe.

A multi selection combo-box is usually part of UI framework's base components, here are some examples from other UI frameworks:

Describe the solution you'd like

Add an option to the ComboBox to make it multi selection by accepting 2 new properties: SelectedItems and MultipleSelection.

<ComboBox ItemsSource="{Binding MyOptionList}" SelectedItems="{Binding MySelectedItemList}" MultipleSelection="true">

The dropdown should display checkboxes next to each item to show which ones are selected or not.

About the new properties, I find "MultipleSelection" being a boolean more user friendly and easier to discover, but given other existing implementations in avalonia it might tempt you to use: SelectionMode="Multiple", but that makes it harder to figure out the keyword "Multiple" when we just need a boolean and everyone is familiar with "true/false".

Describe alternatives you've considered

No response

Additional context

No response

LazaroOnline commented 3 weeks ago

Related to this other doc issue

workgroupengineering commented 3 weeks ago

https://github.com/AvaloniaUI/Avalonia.Labs/pull/60