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); } }
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); } } }
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); } } }
// 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); }
// 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; }