Example #1
0
        public void Begin(FrameworkElement containingObject, INameScope nameScope = null, HandoffBehavior handoffBehavior = HandoffBehavior.SnapshotAndReplace, object layerOwner = null)
        {
            Stop(containingObject);

            TimelineClock clock = CreateClock();

            clock.Begin(((IAnimatable)containingObject).RootClock);

            clocks[containingObject] = clock;

            ListDictionary <TargetKey, AnimationTimelineClock> targets = GetAnimationClocksTargets(clock, containingObject, nameScope ?? NameScope.GetContainingNameScope(containingObject));

            foreach (TargetKey target in targets.GetKeys())
            {
                target.Target.ApplyAnimationClocks(target.TargetProperty, targets.GetValues(target), handoffBehavior, layerOwner);
            }
        }
Example #2
0
        private void GetAnimationClocksTargets(TimelineClock clock, FrameworkElement containingObject, INameScope nameScope, ref ListDictionary <TargetKey, AnimationTimelineClock> targets)
        {
            AnimationTimelineClock animationClock = clock as AnimationTimelineClock;

            if (animationClock != null)
            {
                TargetKey target = GetClockTarget(animationClock, containingObject, nameScope);
                if (target != null)
                {
                    targets.Add(target, animationClock);
                }
            }

            TimelineGroupClock clockGroup = clock as TimelineGroupClock;

            if (clockGroup != null)
            {
                foreach (TimelineClock child in clockGroup.Children)
                {
                    GetAnimationClocksTargets(child, containingObject, nameScope, ref targets);
                }
            }
        }
Example #3
0
        private void GetAnimationClocksTargets(TimelineClock clock, FrameworkElement containingObject, INameScope nameScope, ref ListDictionary<TargetKey, AnimationTimelineClock> targets)
        {
            AnimationTimelineClock animationClock = clock as AnimationTimelineClock;
            if (animationClock != null)
            {
                TargetKey target = GetClockTarget(animationClock, containingObject, nameScope);
                if (target != null)
                {
                    targets.Add(target, animationClock);
                }
            }

            TimelineGroupClock clockGroup = clock as TimelineGroupClock;
            if (clockGroup != null)
            {
                foreach (TimelineClock child in clockGroup.Children)
                {
                    GetAnimationClocksTargets(child, containingObject, nameScope, ref targets);
                }
            }
        }
Example #4
0
        // collect inner animations clocks that define Storyboard.Target, Storyboard.TargetName, or Storyboard.TargetProperty
        private ListDictionary <TargetKey, AnimationTimelineClock> GetAnimationClocksTargets(TimelineClock clock, FrameworkElement containingObject, INameScope nameScope)
        {
            ListDictionary <TargetKey, AnimationTimelineClock> targets = new ListDictionary <TargetKey, AnimationTimelineClock>();

            GetAnimationClocksTargets(clock, containingObject, nameScope, ref targets);
            return(targets);
        }
Example #5
0
 // collect inner animations clocks that define Storyboard.Target, Storyboard.TargetName, or Storyboard.TargetProperty
 private ListDictionary<TargetKey, AnimationTimelineClock> GetAnimationClocksTargets(TimelineClock clock, FrameworkElement containingObject, INameScope nameScope)
 {
     ListDictionary<TargetKey, AnimationTimelineClock> targets = new ListDictionary<TargetKey, AnimationTimelineClock>();
     GetAnimationClocksTargets(clock, containingObject, nameScope, ref targets);
     return targets;
 }