Accordion control provides expand modes to make the control more useful in fitting into different application UIs. This is useful in cases where you want to conserve screen real estate so that the user is free of unnecessary distractions. Just like the musical instrument accordion, the Accordion control provides the flexibility to tightly compress for storage and then decompress when a player wants to use it.
Accordion provides the ExpandMode property to determine how the expander control can be expanded or collapsed. The ExpandMode enumeration provides three options, One, Collapsible or Any for this purpose.
Expand Modes |
Description |
One |
Only one item in the Accordion control can be expanded one at a time. This is the default option. |
Collapsible |
All items in the Accordion control can be expanded or collapsed one at a time. |
Any |
Any item in the Accordion control can be expanded or collapsed as per the need of the user. |
The code snippet below illustrates how to set the Expand mode to 'collapsible' in Accordion for WPF control.