Ler em inglês

Compartilhar via


ExpandDirection Enumeração

Definição

Especifica a direção na qual um controle Expander é aberto.

C#
public enum ExpandDirection
Herança
ExpandDirection

Campos

Nome Valor Description
Down 0

O controle Expander é aberto para baixo.

Left 2

O controle Expander é aberto para a esquerda.

Right 3

O controle Expander é aberto para a direita.

Up 1

O controle Expander é aberto para cima.

Exemplos

O exemplo a seguir mostra como definir a ExpandDirection propriedade como um ExpandDirection membro de enumeração.

XAML
<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>
C#
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;
}

Comentários

Para especificar a direção que um Expander controle expande, defina a ExpandDirection propriedade como um dos membros de enumeração.

Aplica-se a

Produto Versões
.NET Framework 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1
Windows Desktop 3.0, 3.1, 5, 6, 7, 8, 9

Confira também