WPF selector - How can I guarantee that it will allow you to make only one choice, and not several options?

Basically, I have a control that I want to extend from the Selector Class . I know that Selector allows you to select multiple children, but I don't want this. I want only one child to be selected at a time.

Is there a parameter that I do not see in the Selector class that distinguishes one or more selected options, or is it something that is controlled by the class that I am writing that extends the Selector class?

+6
source share
2 answers

The selector does not support multiple choices. ListBox and, therefore, ListView, support several options.

In any case, you are responsible for the actual selection of the items. The selector simply provides the properties and events associated with the selection.

+2
source

Have you tried MultiSelector ? It has the CanSelectMultipleItems property, which can help.

+4
source

Source: https://habr.com/ru/post/888647/


All Articles