Чтоб по нажатию на батон OnMouseDown1 наследовалось для следушей имедж
| Код | <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Class="WpfApplication3.Window1" x:Name="Window" Title="Window1" Width="640" Height="480"> <Window.Resources> <Storyboard x:Key="OnMouseDown1"> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(SkewTransform.AngleY)"> <SplineDoubleKeyFrame KeyTime="00:00:02" Value="-3"/> <SplineDoubleKeyFrame KeyTime="00:00:06.1000000" Value="-26"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[1].(SkewTransform.AngleX)"> <SplineDoubleKeyFrame KeyTime="00:00:02" Value="0"/> <SplineDoubleKeyFrame KeyTime="00:00:06.1000000" Value="-6"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"> <SplineDoubleKeyFrame KeyTime="00:00:02" Value="1.841"/> <SplineDoubleKeyFrame KeyTime="00:00:06.1000000" Value="1.143"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleY)"> <SplineDoubleKeyFrame KeyTime="00:00:02" Value="1.841"/> <SplineDoubleKeyFrame KeyTime="00:00:06.1000000" Value="1.143"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)"> <SplineDoubleKeyFrame KeyTime="00:00:02" Value="110.308"/> <SplineDoubleKeyFrame KeyTime="00:00:06.1000000" Value="18.7"/> </DoubleAnimationUsingKeyFrames> <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)"> <SplineDoubleKeyFrame KeyTime="00:00:02" Value="65.779"/> <SplineDoubleKeyFrame KeyTime="00:00:06.1000000" Value="11.151"/> </DoubleAnimationUsingKeyFrames> </Storyboard> </Window.Resources> <Window.Triggers> <EventTrigger RoutedEvent="Mouse.MouseDown" SourceName="image"> <BeginStoryboard Storyboard="{StaticResource OnMouseDown1}"/> </EventTrigger> </Window.Triggers>
<Grid x:Name="LayoutRoot"> <Image x:Name="image" HorizontalAlignment="Left" Margin="96,102,0,134" Width="219.793" Source="1.jpg" RenderTransformOrigin="0.6,0.4"> <Image.RenderTransform> <TransformGroup> <ScaleTransform/> <SkewTransform AngleX="-6" AngleY="-25"/> <RotateTransform Angle="0.5"/> <TranslateTransform/> </TransformGroup> </Image.RenderTransform> </Image> <Button HorizontalAlignment="Right" Margin="0,33,68,0" VerticalAlignment="Top" Width="113" Height="35" Content="Button"/> </Grid> </Window>
|
|