ExpandDirection 列舉
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
指定 Expander 控制項開啟的方向。
public enum class ExpandDirection
public enum ExpandDirection
type ExpandDirection =
Public Enum ExpandDirection
- 繼承
欄位
Down | 0 | Expander 控制項會向下開啟。 |
Left | 2 | Expander 控制項會向左開啟。 |
Right | 3 | Expander 控制項會向右開啟。 |
Up | 1 | Expander 控制項會向上開啟。 |
範例
下列範例示範如何將 屬性設定 ExpandDirection 為 ExpandDirection 列舉成員。
<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
備註
若要指定控制項展開的方向 Expander ,請將 ExpandDirection 屬性設定為其中一個列舉成員。