Intersoft ClientUI Documentation
ExpandableContentPresenter

ExpandableContentPresenter is a simple content control with expandable / collapsible feature.

Content Control

ExpandableContentPresenter is inherited from ISContentControl, which means that it can contain a single object of any types, such as a string, an image, or a panel. For more information about this content model, see Content Model Overview.

The content of ExpandableContentPresenter must be a UIElement with fixed Height and/or Width, which is used as reference for the expand and collapse animation.

To expand and collapse the content, simply set the IsExpanded property to true and false respectively. Alternatively, you can use your own animation or storyboard to animate the Percentage property. The Percentage property indicates the area that is currently expanded, which allows you to easily animate this value, from 0 (Collapsed) to 1 (Fully Expanded).

The following example shows how to use the ExpandableContentPresenter control.

XAML
Copy Code
<Intersoft:ExpandableContentPresenter x:Name="ExpandableContainer" VerticalAlignment="Top" FontSize="32">
    <Grid Height="100">
        <Grid.Background>
            <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0">
                <GradientStop Color="#FFFF8027" Offset="0.004"/>
                <GradientStop Color="#FF8F3B00" Offset="1"/>
            </LinearGradientBrush>
        </Grid.Background>
        <ContentPresenter Content="Content Presenter" HorizontalAlignment="Center" VerticalAlignment="Center"/>
    </Grid>
</Intersoft:ExpandableContentPresenter>
<Intersoft:UXCheckBox Content="Expand / Collapsed" HorizontalAlignment="Center" VerticalAlignment="Center" 
                      CheckedState="{Binding IsExpanded, ElementName=ExpandableContainer, Mode=TwoWay}" />    
See Also