WPF レイアウトコントロール
モードの展開する
WPF レイアウトコントロール > Accordionの概要 > 展開および折りたたみ > モードの展開する

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.

<c1:C1Accordion x:Name="accordion" ExpandMode="Collapsible" Width="300" Margin="25">
</c1:C1Accordion>
accordion.ExpandMode = C1.WPF.Accordion.ExpandMode.Collapsible;