我在WPF中编程(C#)。我希望Expander
在StackPanel
中慢慢展开和折叠。我使用的代码是:
<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,则相当可观。
感谢。