3

I'm programming in WPF(C#). I want to Expander expands and collapses slowly in a StackPanel. The codes I used are:

<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>

The animation do not effect my code. How can I fix it?
It is considerable, if your codes are only XAML.

thanks.

Babak.Abad
  • 2,839
  • 10
  • 40
  • 74
  • I created a style for an Expander, but it seems that you want to animate the StackPanel. Anyway, I moved the solution to another [related question](http://stackoverflow.com/a/42361229/5615980) – rmojab63 Feb 21 '17 at 07:39

0 Answers0