ExpandDirection Enumeration
.NET Framework 4.5
[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]
Specifies the direction in which an Expander control opens.
Namespace: System.Windows.Controls
Assembly: PresentationFramework (in PresentationFramework.dll)
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.
<StackPanel> <RadioButton Name="ExpandDown" Margin="0,10,0,10" IsChecked="True" Checked="ChangeExpandDirection" GroupName="ExpandDirectionProperty"> Expand Down </RadioButton> <RadioButton Name="ExpandUp" Margin="0,0,0,10" Checked="ChangeExpandDirection" GroupName="ExpandDirectionProperty"> Expand Up </RadioButton> <RadioButton Name="ExpandLeft" Margin="0,0,0,10" Checked="ChangeExpandDirection" GroupName="ExpandDirectionProperty"> Expand Left </RadioButton> <RadioButton Name="ExpandRight" Margin="0,0,0,10" Checked="ChangeExpandDirection" GroupName="ExpandDirectionProperty"> Expand Right </RadioButton> </StackPanel>
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 8 Consumer Preview, Windows Server 8 Beta, Windows 7, Windows Server 2008 SP2, Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.