public static void PrepareStoryboard(Storyboard storyboard, AnimationProgress progress, string propertyName)
        {
            Timeline timeline = CreateTimeline();

            Storyboard.SetTarget(timeline, progress);
            Storyboard.SetTargetProperty(timeline, new PropertyPath(propertyName));
            storyboard.Children.Add(timeline);
            storyboard.BeginTime = TimeSpan.Zero;
        }
        static void ProgressPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
        {
            AnimationProgress animationProgress = d as AnimationProgress;

            if (animationProgress != null)
            {
                animationProgress.RaiseProgressChanged();
            }
        }
 public PhotoGalleryControl()
 {
     DefaultStyleKey = typeof(PhotoGalleryControl);
     progress        = new AnimationProgress(this);
 }