Ejemplo n.º 1
0
        public object GetValue(DependencyProperty property, object baseValue, PropertyMetadata metadata)
        {
            if (_animations == null)
            {
                return(baseValue);
            }

            AnimationTimelineCollection timelines = _animations[property.GlobalIndex] as AnimationTimelineCollection;

            if (timelines == null)
            {
                return(baseValue);
            }

            foreach (AnimationClock clock in timelines)
            {
                if (clock.CurrentState == ClockState.Stopped)
                {
                    continue;
                }

                baseValue = clock.GetCurrentValue(null, baseValue);
            }

            return(baseValue);
        }
Ejemplo n.º 2
0
        public void BeginAnimation(DependencyProperty property, AnimationTimeline animation, HandoffBehavior handoffBehavior)
        {
            if (_animations == null)
            {
                _animations = new Hashtable();
            }

            AnimationTimelineCollection timelines = _animations[property.GlobalIndex] as AnimationTimelineCollection;

            if (timelines == null)
            {
                _animations[property.GlobalIndex] = timelines = new AnimationTimelineCollection();
            }

            timelines.Add(animation);
        }