示例#1
0
        /*private List<Tuple<IAnimatable, DependencyProperty>> animatedPropertyList =
            new List<Tuple<IAnimatable, DependencyProperty>>();*/

        /// <summary>
        /// アニメーションを開始します。
        /// </summary>
        public void Begin(Animatable target)
        {
            foreach (var anim in Children)
            {
                if (anim == null)
                {
                    continue;
                }

                var animTarget = GetTarget(anim);
                if (animTarget == null)
                {
                    animTarget = target;

                    var targetPath = GetTargetPath(anim);
                    if (!string.IsNullOrEmpty(targetPath))
                    {
                        var targetProperty = WPFUtil.GetDependencyProperty(
                            target.GetType(),
                            targetPath);

                        if (targetProperty != null)
                        {
                            var t = target.GetValue(targetProperty) as Animatable;
                            if (t != null)
                            {
                                animTarget = t;
                            }
                        }
                    }
                }

                var property = WPFUtil.GetDependencyProperty(
                    animTarget.GetType(),
                    GetTargetProperty(anim));

                if (property != null)
                {
                    animTarget.BeginAnimation(property, anim);
                }

                /*this.animatedPropertyList.Add(
                    Tuple.Create(animTarget, property));*/
            }
        }