locked
Storyboard +Triggers RRS feed

  • Question

  • Hi!

    I have made a silverlight application for my travel website I use a banner with picture on my left side running silverlight and a storyboard. It works great inside blend 3 but when I hit f5 to run it in my explorer nothing happens. I read alot about triggers but cannot find this menu under Objects and Timeline and not in any otherplace inside my blend 3 app. How do I get my storyboard running?

    Please give me easy instuctions since I am a newbie.

    Best regards
    Jimmy

    Saturday, August 22, 2009 8:38 PM

Answers

All replies

  • Hi,
     With your StoryBoard loaded and selected look at the RH toolbar.
    You should see "Trigger", if it is collapsed click to expand it.
    Now you can add new EventTrigger's as needed.
    You can also do it from the Assets / Behaviors...but the method above is a bit easier.

    So for example I have a new StoryBoard with an object I've animated on the timeline.
    My object is named "crema".
    I load the StoryBoard then expand the Triggers toolbar section and add a new EventTrigger for my object by name: crema
    I'll chose the type "loaded", which will start the "crema" animation on my storyboard when the app is run.

    Pretty simple once you get used to it...I'll be adding some Webcasts soon, requests are welcome.
      All the best,
        Mark
    Saturday, August 22, 2009 10:31 PM
  • My problem is like this one!

    http://silverlight.net/forums/t/20033.aspx

    I tried to do it with to diffrent kind of project types
    Silverlight 3 Application + website
    Silverlight 3 application

    But I cannot find my event trigger.

    The second one is the right one for a banner? Here is my code and I will have storyboard1 running:

    <UserControl
     xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
     xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
     x:Class="puravida3.MainPage"
     Width="200" Height="600">

     <UserControl.Resources>
     


      <Storyboard x:Name="Storyboard1">
       <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
        <EasingDoubleKeyFrame KeyTime="00:00:05" Value="314"/>
       </DoubleAnimationUsingKeyFrames>
       <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
        <EasingDoubleKeyFrame KeyTime="00:00:05" Value="62"/>
       </DoubleAnimationUsingKeyFrames>
       <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
        <EasingDoubleKeyFrame KeyTime="00:00:05" Value="-13.429"/>
       </DoubleAnimationUsingKeyFrames>
       <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image1" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
        <EasingDoubleKeyFrame KeyTime="00:00:05" Value="235"/>
       </DoubleAnimationUsingKeyFrames>
       <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image1" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
        <EasingDoubleKeyFrame KeyTime="00:00:05" Value="-34"/>
       </DoubleAnimationUsingKeyFrames>
       <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image1" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
        <EasingDoubleKeyFrame KeyTime="00:00:05" Value="7.192"/>
       </DoubleAnimationUsingKeyFrames>
       <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image2" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.Y)">
        <EasingDoubleKeyFrame KeyTime="00:00:05" Value="186"/>
       </DoubleAnimationUsingKeyFrames>
       <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image2" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
        <EasingDoubleKeyFrame KeyTime="00:00:05" Value="42"/>
       </DoubleAnimationUsingKeyFrames>
       <DoubleAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="image2" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
        <EasingDoubleKeyFrame KeyTime="00:00:05" Value="-8.03"/>
       </DoubleAnimationUsingKeyFrames>
      </Storyboard>


     </UserControl.Resources>

     <Grid x:Name="LayoutRoot" Background="White">
      <Image x:Name="image2" Height="134" Margin="28,24,71,0" VerticalAlignment="Top" Source="blandatsept06.jpg" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
       <Image.RenderTransform>
        <TransformGroup>
         <ScaleTransform/>
         <SkewTransform/>
         <RotateTransform/>
         <TranslateTransform/>
        </TransformGroup>
       </Image.RenderTransform>
      </Image>
      <Image x:Name="image1" Height="101" Margin="46,97,19,0" VerticalAlignment="Top" Source="jimmybeach.jpg" Stretch="Fill" RenderTransformOrigin="0.5,0.5">
       <Image.RenderTransform>
        <TransformGroup>
         <ScaleTransform/>
         <SkewTransform/>
         <RotateTransform/>
         <TranslateTransform/>
        </TransformGroup>
       </Image.RenderTransform>
      </Image>
      <Image x:Name="image" Margin="17,116,82,0" Source="Peggykite2008.jpg" Stretch="Fill" Height="135" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5">
       <Image.RenderTransform>
        <TransformGroup>
         <ScaleTransform/>
         <SkewTransform/>
         <RotateTransform/>
         <TranslateTransform/>
        </TransformGroup>
       </Image.RenderTransform>
      </Image>
     </Grid>
    </UserControl>

    Best regards Jimmy

    Sunday, August 23, 2009 6:21 AM
  • I get the Triggers menu when I'm doing a WPF project. But can I use WPF projects in my browser?
    Sunday, August 23, 2009 5:49 PM
  • I found a solution for my problem.

    Did go to the assets menu and choose Behaviors then controlstoryboardaction. Then just adjusted the properties for my storyboard. Obs you have to add the references for Interativity look at this link!

    http://www.silverlightshow.net/items/Behaviors-and-Triggers-in-Silverlight-3.aspx

    Best regards
    Jimmy
    • Marked as answer by vind-surfer Sunday, August 23, 2009 6:12 PM
    Sunday, August 23, 2009 6:12 PM