慢慢展开和折叠扩展器

时间:2017-02-20 22:43:35

标签: wpf xaml animation storyboard expander

我在WPF中编程(C#)。我希望ExpanderStackPanel中慢慢展开和折叠。我使用的代码是:

<StackPanel>
    <StackPanel.Triggers>
        <EventTrigger RoutedEvent="Expander.Expanded" >
            <BeginStoryboard>
                <Storyboard>
                    <DoubleAnimation From="0" To="0.4" Duration="0:0:5.25"  Storyboard.TargetProperty="(FrameworkElement.LayoutTransform).(ScaleTransform.ScaleY)"/>
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </StackPanel.Triggers>

    <Expander Header="Canny">
        <Grid>
            <!-- Some codes, elements, controls, ... -->    
        </Grid>
    </Expander>

    <Expander Header="Sobel">
        <Grid>
            <!-- Some codes, elements, controls, ... -->    
        </Grid>
    </Expander>

    <Expander Header="LoG">
        <Grid>
            <!-- Some codes, elements, controls, ... -->    
        </Grid>
    </Expander>

</StackPanel>

动画不会影响我的代码。我该如何解决?
如果您的代码只是XAML,则相当可观。

感谢。

0 个答案:

没有答案