コード例 #1
0
ファイル: Storyboard.cs プロジェクト: portalninja/Granular
        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);
            }
        }
コード例 #2
0
ファイル: Storyboard.cs プロジェクト: portalninja/Granular
        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);
                }
            }
        }
コード例 #3
0
ファイル: Storyboard.cs プロジェクト: highzion/Granular
        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);
                }
            }
        }
コード例 #4
0
ファイル: Storyboard.cs プロジェクト: portalninja/Granular
        // 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);
        }
コード例 #5
0
ファイル: Storyboard.cs プロジェクト: highzion/Granular
 // 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;
 }