Codejock Forums Homepage
Forum Home Forum Home > General > XAML Snippets
  New Posts New Posts RSS Feed - Event Trigger issue
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Event Trigger issue

 Post Reply Post Reply
Author
Message
Megalith View Drop Down
Newbie
Newbie


Joined: 15 February 2011
Location: North London
Status: Offline
Points: 1
Post Options Post Options   Thanks (0) Thanks(0)   Quote Megalith Quote  Post ReplyReply Direct Link To This Post Topic: Event Trigger issue
    Posted: 15 February 2011 at 12:37pm
Hi all,

Got an issue with triggering animations in xaml, my code creates resources for 3 objects which are animated, what i am looking for is to animate when the mouse is moved over the object and not when it inters the viewport. The code i'm using is a 3d ui testbed application but the procedure would i imagine be the same for any storyboard animation.

This block of code is where i have the issue

		<Viewport3D.Triggers>
            <EventTrigger RoutedEvent="Viewport3D.Loaded">
                <EventTrigger.Actions>
                    <BeginStoryboard Storyboard="{StaticResource OnLoaded}" />
                </EventTrigger.Actions>
            </EventTrigger>
            <EventTrigger RoutedEvent="Viewport3D.MouseEnter">
                <EventTrigger.Actions>
                    <BeginStoryboard Storyboard="{StaticResource OnMouseEnter}" />
                </EventTrigger.Actions>
            </EventTrigger>
        </Viewport3D.Triggers>

The line RoutedEvent="Viewport3D.MouseEnter" is where i have my issue. Here is the storyboard resource for OnMouseEnter.

               <Storyboard Duration="Forever" FillBehavior="HoldEnd" BeginTime="0:0:0" x:Key="OnMouseEnter"  d:StoryboardName="OnMouseEnter">

                    <Rotation3DAnimationUsingKeyFrames RepeatBehavior="Forever" BeginTime="0:0:0" Duration="0:0:2" Storyboard.TargetName="Box02OR17" Storyboard.TargetProperty="(Model3DGroup.Transform).(Transform3DGroup.Children)[2].(RotateTransform3D.Rotation)">
                    <LinearRotation3DKeyFrame KeyTime="0:0:0">
                        <LinearRotation3DKeyFrame.Value>
                            <AxisAngleRotation3D Angle="0.2457704544067372" Axis="0 0 1"/>
                        </LinearRotation3DKeyFrame.Value>
                    </LinearRotation3DKeyFrame>
                    <LinearRotation3DKeyFrame KeyTime="0:0:0.5">
                        <LinearRotation3DKeyFrame.Value>
                            <AxisAngleRotation3D Angle="45.00063628154822" Axis="-0.9999842950747802 0.002144721422138701 0.005177815544839366"/>
                        </LinearRotation3DKeyFrame.Value>
                    </LinearRotation3DKeyFrame>
                    <LinearRotation3DKeyFrame KeyTime="0:0:1">
                        <LinearRotation3DKeyFrame.Value>
                            <AxisAngleRotation3D Angle="0.2457704544067372" Axis="0 0 1"/>
                        </LinearRotation3DKeyFrame.Value>
                    </LinearRotation3DKeyFrame>
                    <LinearRotation3DKeyFrame KeyTime="0:0:1.5">
                        <LinearRotation3DKeyFrame.Value>
                            <AxisAngleRotation3D Angle="45.00063628154822" Axis="0.9999842950747802 -0.002144721422138701 0.005177815544839366"/>
                        </LinearRotation3DKeyFrame.Value>
                    </LinearRotation3DKeyFrame>
                    <LinearRotation3DKeyFrame KeyTime="0:0:2">
                        <LinearRotation3DKeyFrame.Value>
                            <AxisAngleRotation3D Angle="0.2457704544067372" Axis="0 0 1"/>
                        </LinearRotation3DKeyFrame.Value>
                    </LinearRotation3DKeyFrame>
                </Rotation3DAnimationUsingKeyFrames>
                </Storyboard>

How/What can i do to animate this storyboard when the mouse enters the specific resource rather than any resource in the ViewPort3D?
Back to Top
 Post Reply Post Reply
  Share Topic   

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.04
Copyright ©2001-2021 Web Wiz Ltd.

This page was generated in 0.188 seconds.