WPF レイアウトコントロール
展開可能性
WPF レイアウトコントロール > Expander for WPF の概要 > 展開可能性

By default, you can expand the content area of the Expander control by simply clicking on the header bar as IsExpandable property of the Expander control is set to True. However, there might be a scenario where you may want to prevent expansion of the Expander control until a specific event occurs. In that case, you would need to set IsExpandable property to False as you want the Expander control to remain collapsed until the occurrence of the specified event.

The following code showcases the use of the IsExpandable property. In this example, the IsExpandable property is set to false to keep the Expander control in collapsed state.

<c1:C1Expander x:Name="ExpanderControl" Header="Expand Me!" IsExpandable="False" FontFamily="Cambria" FontWeight="Bold" VerticalAlignment="Center" HorizontalAlignment="Center">
        <CheckBox Margin="10" VerticalAlignment="Center" x:Name="Condition" Content="CheckBox Inside Expander"/>
</c1:C1Expander>
ExpanderControl.IsExpandable = false;