1

嗨,我想让这个扩展器垂直对齐而不是水平对齐,箭头垂直面向以及 atm 它看起来像这样:

打开:

在此处输入图像描述

关闭:

在此处输入图像描述

    <StackPanel>
        <StackPanel.Triggers>
            <EventTrigger RoutedEvent="Expander.Expanded" SourceName="expander">
                <EventTrigger.Actions>
                    <BeginStoryboard>
                        <Storyboard>
                            <DoubleAnimation From="0" To="1" Duration="0:0:0.25" Storyboard.TargetName="listBox" Storyboard.TargetProperty="(FrameworkElement.LayoutTransform).(ScaleTransform.ScaleY)"/>
                        </Storyboard>
                    </BeginStoryboard>
                </EventTrigger.Actions>
            </EventTrigger>
        </StackPanel.Triggers>
        <Expander x:Name="expander" Header="Expander" Expanded="expander_Expanded">
            <ListBox x:Name="listBox">
                <ListBoxItem Content="ListBoxItem" />
                <ListBoxItem Content="ListBoxItem" />
                <ListBoxItem Content="ListBoxItem" />
                <ListBox.LayoutTransform>
                    <ScaleTransform ScaleX="1" ScaleY="0"/>
                </ListBox.LayoutTransform>
            </ListBox>
        </Expander>
    </StackPanel>
4

1 回答 1

4

更改ExpandDirection.

于 2012-04-15T03:51:13.210 回答