protected override void CopyCurrentValueCore(Animatable sourceAnimatable)
    {
      // The timeline to copy properties from. 
      // If this parameter is null, this timeline is constructed with default property values.

//			if(sourceAnimatable == null)
//				CopyCore(sourceFreezable);
    }
示例#2
0
 public DeploymentAnimation(Dispatcher dispatcher, Animatable animationedObject, bool isDeploying, double animationTime, double stowedValue, double deployedValue)
 {
     _Dispatcher = dispatcher;
     _AnimationedObject = animationedObject;
     _IsDeploying = isDeploying;
     _StowedValue = stowedValue;
     _DeployedValue = deployedValue;
     AnimationTime = animationTime;
     _StopAnimation = new DoubleAnimation();
     _StopAnimation.BeginTime = null;
 }
示例#3
0
 //动画
 public static void DoMove(Animatable uie, DependencyProperty dp, double to, double ar, double dr, double duration)
 {
     var doubleAnimation = new DoubleAnimation
         {
             To = to,
             Duration = TimeSpan.FromSeconds(duration),
             AccelerationRatio = ar,
             DecelerationRatio = dr,
             FillBehavior = FillBehavior.HoldEnd
         };//创建双精度动画对象
     uie.BeginAnimation(dp, doubleAnimation);//设置动画应用的属性并启动动画
 }
示例#4
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));*/
            }
        }
示例#5
0
 protected override void CopyCurrentValueCore(Animatable sourceAnimatable) {}
示例#6
0
 /// <summary>
 /// The animate opacity.
 /// </summary>
 /// <param name="obj">
 /// The obj.
 /// </param>
 /// <param name="toOpacity">
 /// The to opacity.
 /// </param>
 /// <param name="animationTime">
 /// The animation time.
 /// </param>
 private void AnimateOpacity(Animatable obj, double toOpacity, double animationTime)
 {
     var animation = new DoubleAnimation(toOpacity, new Duration(TimeSpan.FromMilliseconds(animationTime)))
         {
             AccelerationRatio = 0.3,
             DecelerationRatio = 0.5
         };
     animation.Completed += this.AnimationCompleted;
     obj.BeginAnimation(UIElement.OpacityProperty, animation);
 }
		static void Animate(Animatable element, DependencyProperty property, double to)
		{
			element.BeginAnimation(property, new DoubleAnimation(to, new Duration(animationTime), FillBehavior.HoldEnd),
			                       HandoffBehavior.SnapshotAndReplace);
		}
        /*private void face_MouseLeave(object sender, MouseEventArgs e)
        {
                        var el = (ModelUIElement3D) sender;
                        var model = el.Model as GeometryModel3D;
                        var mg = model.Material as MaterialGroup;
                        var dm = mg.Children[0] as DiffuseMaterial;
                        AnimateOpacity(dm.Brush, 0.8, 200);
        }

        private void face_MouseEnter(object sender, MouseEventArgs e)
        {
            var el = (ModelUIElement3D) sender;
                var model = el.Model as GeometryModel3D;
                var mg=model.Material as MaterialGroup;
                var dm=mg.Children[0] as DiffuseMaterial;
                AnimateOpacity(dm.Brush, 1.0, 200);
        }*/


        private void AnimateOpacity(Animatable obj, double toOpacity, double animationTime)
        {
            var a = new DoubleAnimation(toOpacity,
                                        new Duration(TimeSpan.FromMilliseconds(animationTime))) { AccelerationRatio = 0.3, DecelerationRatio = 0.5 };
            a.Completed += new EventHandler(a_Completed);
            obj.BeginAnimation(UIElement.OpacityProperty, a);
        }