Example #1
0
        public void Remove(FrameworkElement containingObject, INameScope nameScope = null, object layerOwner = null)
        {
            Stop(containingObject);

            TimelineClock clock;

            if (clocks.TryGetValue(containingObject, out clock))
            {
                ListDictionary <TargetKey, AnimationTimelineClock> targets = GetAnimationClocksTargets(clock, containingObject, nameScope ?? NameScope.GetContainingNameScope(containingObject));
                foreach (TargetKey target in targets.GetKeys())
                {
                    target.Target.RemoveAnimationClocks(target.TargetProperty, targets.GetValues(target), layerOwner);
                }
                clocks.Remove(containingObject);
            }
        }
Example #2
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);
            }
        }