Skip to main content

DevExpress v24.1 Update — Your Feedback Matters

Our What's New in v24.1 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DXExpander Class

Represents the DXExpander control.

Namespace: DevExpress.Xpf.Core

Assembly: DevExpress.Xpf.Core.v24.1.dll

NuGet Package: DevExpress.Wpf.Core

#Declaration

public class DXExpander :
    Decorator

The following members return DXExpander objects:

#Remarks

The DXExpander control enables you to make your user interface elements expandable. The DXExpander’s content can be expanded or collapsed with a predefined or custom animation.

DXExpander

The DXExpander‘s expand state is specified via the DXExpander.IsExpanded property. When the DXExpander.IsExpanded property’s value is changed, the DXExpander plays the collapse or expand animation. To obtain the current progress of animation play, use the DXExpander.AnimationProgress property. To obtain whether the DXExpander is currently expanding or collapsing, use the DXExpander.Expanding and DXExpander.Collapsing properties, respectively.

The DXExpander can play two types of animation: horizontal and vertical, and provides three animation styles for each type. The horizontal animation styles are used to display content collapsing or expanding from left to right, from right to left, or from center to edges. The vertical animation styles represent top-to-bottom, bottom-to-top and center-to-edges animation. Animation styles are specified by the DXExpander.HorizontalExpand and DXExpander.VerticalExpand properties. You can also specify the animation speed via the DXExpander.Duration property.

The DXExpander‘s content can be either stretched or slid when expanding or collapsing. The animation effect used to show the content is specified by the DXExpander.StretchChild property.

To implement a custom collapse or expand animation, create a Storyboard object representing the animation storyboard, and assign it to the DXExpander.CollapseStoryboard or DXExpander.ExpandStoryboard property, respectively.

#Example

The following example demonstrates how to make visual elements expandable via the DXExpander.In this example, the DXExpander with a GroupBox inside it is placed into a standard Grid. The DXExpander can be expanded (or collapsed) by clicking the ellipsis button. This shows or hides the GroupBox.

<Application x:Class="DXExpander_CreatingAndUsing.App"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             StartupUri="MainWindow.xaml">
    <Application.Resources>

    </Application.Resources>
</Application>
See Also