public override void Update()
        {
            AnimatedNode toValue = _manager.GetNodeById(_toValueNode);

            _animationConfig["toValue"] = ((ValueAnimatedNode)toValue).Value;
            _manager.StartAnimatingNode(_animationId, _valueNode, _animationConfig, null);
        }
        protected override void OnDetachedFromNode(AnimatedNode parent)
        {
            if (parent != _parent)
            {
                throw new InvalidOperationException("Invalid parent node provided.");
            }

            _parent = null;
        }
        public void RemoveChild(AnimatedNode child)
        {
            if (_children == null)
            {
                return;
            }

            child.OnDetachedFromNode(this);
            _children.Remove(child);
        }
        public void AddChild(AnimatedNode child)
        {
            if (_children == null)
            {
                _children = new List <AnimatedNode>(1);
            }

            _children.Add(child);
            child.OnAttachedToNode(this);
        }
        protected override void OnAttachedToNode(AnimatedNode parent)
        {
            if (_parent != null)
            {
                throw new InvalidOperationException("Parent already attached.");
            }

            var valueNode = parent as ValueAnimatedNode;

            if (valueNode == null)
            {
                throw new InvalidOperationException("Parent is not a value node.");
            }

            _parent = valueNode;
        }
        private void StopAnimationsForNode(AnimatedNode animatedNode)
        {
            var length = _activeAnimations.Count;

            UpdateActiveAnimationIds();
            for (var i = 0; i < length; ++i)
            {
                var animationId = _activeAnimationIds[i];
                var animation   = _activeAnimations[animationId];
                if (animatedNode == animation.AnimatedValue)
                {
                    // Invoke animation end callback with {finished: false}
                    animation.EndCallback.Invoke(new JObject
                    {
                        { "finished", false },
                    });

                    _activeAnimations.Remove(animationId);
                }
            }
        }
 protected virtual void OnAttachedToNode(AnimatedNode animatedNode)
 {
 }
 protected virtual void OnDetachedFromNode(AnimatedNode animatedNode)
 {
 }