I've got a storyboard that should play when a page loads. Is there any way to do that directly from Expression Blend? I'd rather not do it through code or xaml.
What about doing the same for button clicks or other events?
Thanks
You can drag the ControlStoryboardAction behaviour (Assets->Behaviors) over to the Page, and set the EventName to be PageLoaded, and ControlStoryboardOption to Play, and Storyboard to your storyboard.
If you decide to do this via code then all you need to do is just to call Begin() of the StoryBoard. Like for example:
<Storyboard x:Name="fadeIn">
<DoubleAnimation Storyboard.TargetName="img"
Storyboard.TargetProperty="Opacity" From="0.0"
To="1.0" Duration="0:0:1" />
</Storyboard>
private void btnFadeIn_Click(object sender, RoutedEventArgs e)
{
this.fadeIn.Begin();
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With