ExpandContainer Class

Combines controls into a headered container that supports the collapse/expand functionality.

Namespace: DevExpress.UI.Xaml.Layout

Assembly: DevExpress.UI.Xaml.Layout.v18.2.dll

Declaration

public class ExpandContainer :
    HeaderedContentContainer,
    IDisposable,
    IItemContainer
Public Class ExpandContainer
    Inherits HeaderedContentContainer
    Implements IDisposable,
               IItemContainer

The ExpandContainer, as its name suggests, supports the expand/collapse functionality. An end-user can expand/collapse the container via a dedicated button. In code, the container's expansion state can be changed via the ExpandContainer.IsExpanded property. The ExpandContainer.Expanded and ExpandContainer.Collapsed events help you respond to an expansion state change.

ExpandContainer

The ExpandContainer supports a single child. You can place any control inside the container. This can be a StackPanel, Grid, etc.

Expandable containers are also supported by the LayoutControl, which is a control providing advanced layout features. To create an expandable container within a LayoutControl, create a LayoutGroup and set its LayoutGroup.AllowExpand property to true.

Examples

The following example creates an ExpandContainer containing a Grid with sample controls:

ExpandContainer_ex

xmlns:Layout="using:DevExpress.UI.Xaml.Layout" 

<StackPanel Width="550" Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
    <Layout:ExpandContainer  Header="Book" >
        <Grid x:Name="LayoutRoot" Width="480" Height="135">
            <Grid.ColumnDefinitions>
                <ColumnDefinition Width="70" />
                <ColumnDefinition Width="250" />
                <ColumnDefinition Width="150" />
            </Grid.ColumnDefinitions>
            <Grid.RowDefinitions>
                <RowDefinition Height="50" />
                <RowDefinition Height="42" />
                <RowDefinition Height="42"/>
            </Grid.RowDefinitions>
            <TextBlock Text="Title:" Grid.Column="0" Grid.Row="0" VerticalAlignment="Center"/>
            <TextBlock Text="Author:" Grid.Column="0" Grid.Row="1" VerticalAlignment="Center"/>
            <TextBlock Text="ISBN:" Grid.Column="0" Grid.Row="2" VerticalAlignment="Center"/>

            <TextBox Text="Alice's Adventures in Wonderland" Grid.Column="1" Grid.Row="0" VerticalAlignment="Center"/>
            <TextBox Text="Lewis Carroll" Grid.Column="1" Grid.Row="1" VerticalAlignment="Center"/>
            <TextBox Text="978-2839217859" Grid.Column="1" Grid.Row="2" VerticalAlignment="Center"/>
            <Image Grid.Column="2" Grid.Row="0" Grid.RowSpan="3" Source="Images/Books.png"/>
        </Grid>
    </Layout:ExpandContainer>
</StackPanel>

Inheritance

Object
DevExpress.UI.Xaml.Layout.VisualElements.veContentControlBase
DevExpress.UI.Xaml.Layout.VisualElements.veContentControl

Implements

See Also