ExpandDirection Enumerazione
Definizione
Importante
Alcune informazioni sono relative alla release non definitiva del prodotto, che potrebbe subire modifiche significative prima della release definitiva. Microsoft non riconosce alcuna garanzia, espressa o implicita, in merito alle informazioni qui fornite.
Specifica la direzione nella quale si apre il controllo Expander.
public enum class ExpandDirection
public enum ExpandDirection
type ExpandDirection =
Public Enum ExpandDirection
- Ereditarietà
Campi
Down | 0 | Il controllo Expander apre verso il basso. |
Left | 2 | Il controllo Expander apre verso sinistra. |
Right | 3 | Il controllo Expander apre verso destra. |
Up | 1 | Il controllo Expander apre verso l’alto. |
Esempio
Nell'esempio seguente viene illustrato come impostare la ExpandDirection proprietà su un ExpandDirection membro di enumerazione.
<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;
}
Private Sub ChangeExpandDirection(ByVal Sender As Object, ByVal e As RoutedEventArgs)
If (ExpandDown.IsChecked) Then
myExpander.ExpandDirection = ExpandDirection.Down
ElseIf (ExpandUp.IsChecked) Then
myExpander.ExpandDirection = ExpandDirection.Up
ElseIf (ExpandLeft.IsChecked) Then
myExpander.ExpandDirection = ExpandDirection.Left
ElseIf (ExpandRight.IsChecked) Then
myExpander.ExpandDirection = ExpandDirection.Right
End If
'Expand myExpander so it is easier to see the effect of changing
'the ExpandDirection property for My Expander
myExpander.IsExpanded = True
End Sub
Commenti
Per specificare la direzione espansa da un Expander controllo, impostare la ExpandDirection proprietà su uno dei membri dell'enumerazione.