Windows apps
Collapse the table of content
Expand the table of content
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ExpandDirection Enumeration

Specifies the direction in which an Expander control opens.

Namespace:  System.Windows.Controls
Assembly:  PresentationFramework (in PresentationFramework.dll)

public enum ExpandDirection
<object property="enumerationMemberName" .../>

Member nameDescription
DownThe Expander control opens down.
UpThe Expander control opens up.
LeftThe Expander control opens left.
RightThe Expander control opens right.

To specify the direction that an Expander control expands, set the ExpandDirection property to one of the enumeration members.

The following example shows how to set the ExpandDirection property to an ExpandDirection enumeration member. For the complete sample, see Expander Sample.

  <RadioButton Name="ExpandDown" Margin="0,10,0,10" 
     Expand Down
  <RadioButton Name="ExpandUp" Margin="0,0,0,10"
     Expand Up
  <RadioButton Name="ExpandLeft" Margin="0,0,0,10"
    Expand Left
  <RadioButton Name="ExpandRight" Margin="0,0,0,10"
    Expand Right
private void ChangeExpandDirection(object sender, RoutedEventArgs e)
    if ((Boolean)ExpandDown.IsChecked)
        myExpander.ExpandDirection = ExpandDirection.Down;
    else if ((Boolean)ExpandUp.IsChecked)
        myExpander.ExpandDirection = ExpandDirection.Up;
    else if ((Boolean)ExpandLeft.IsChecked)
        myExpander.ExpandDirection = ExpandDirection.Left;
    else if ((Boolean)ExpandRight.IsChecked)
        myExpander.ExpandDirection = ExpandDirection.Right;

    //Expand myExpander so it is easier to see the effect of changing  
    //the ExpandDirection property for My Expander
    myExpander.IsExpanded = true;

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0

Community Additions

© 2017 Microsoft