WPF 多控件调用一个动画 传递参数
我页面有几个Grid,想点击不同按钮时相应的Grid做翻页的动画,动画的定义有下面代码
<Storyboard x:Key="Storyboard1"> <DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)" Storyboard.TargetName="Second"> <EasingDoubleKeyFrame KeyTime="0:0:2" Value="-47.427"/> </DoubleAnimationUsingKeyFrames> </Storyboard>
<Grid Name="First" Width="500" Height="300" Background="#FF39E421" RenderTransformOrigin="0.1,0.1" > <Grid.RenderTransform> <TransformGroup> <ScaleTransform/> <SkewTransform/> <RotateTransform/> <TranslateTransform/> </TransformGroup> </Grid.RenderTransform> </Grid> <Grid Name="Second" Width="400" Height="200" Background="#FFE4214E" RenderTransformOrigin="0.1,0.1" > <Grid.RenderTransform> <TransformGroup> <ScaleTransform/> <SkewTransform/> <RotateTransform/> <TranslateTransform/> </TransformGroup> </Grid.RenderTransform> </Grid>