Skip to content

Instantly share code, notes, and snippets.

@rzhw
Created February 23, 2013 03:52
Show Gist options
  • Save rzhw/5018301 to your computer and use it in GitHub Desktop.
Save rzhw/5018301 to your computer and use it in GitHub Desktop.
StoryboardAction for Windows.UI.Interactivity on WinRT / Windows Runtime
using System;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Markup;
using Windows.UI.Xaml.Media.Animation;
using Windows.UI.Interactivity;
namespace Windows.UI.Interactivity
{
[ContentProperty(Name = "Storyboard")]
public class StoryboardAction : Windows.UI.Interactivity.TriggerAction<FrameworkElement>
{
public static readonly DependencyProperty StoryboardProperty =
DependencyProperty.Register("Storyboard", typeof(Storyboard), typeof(StoryboardAction), null);
public Storyboard Storyboard
{
get { return (Storyboard)GetValue(StoryboardProperty); }
set { SetValue(StoryboardProperty, value); }
}
protected override void Invoke(object parameter)
{
if (this.AssociatedObject == null)
return;
Storyboard.Begin();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment