Пример #1
0
        public static DoubleAnimationUsingKeyFrames CreateDoubleAnimation(UIElement targetElement, DependencyProperty targetProperty, KeySpline toKeySpline, double toValue, double fromValue = 0.0, KeySpline fromKeySpline =null, TimeSpan? beginTimeSpan = null, TimeSpan? durationSpan = null)
        {
            var animation = CreateDoubleAnimation(toKeySpline,toValue ,fromValue, fromKeySpline,beginTimeSpan, durationSpan);
            Storyboard.SetTarget(animation, targetElement);
            Storyboard.SetTargetProperty(animation, new PropertyPath(targetProperty));

            return animation;
        }
 /// <summary>Initializes a new instance of the <see cref="T:System.Windows.Media.Animation.SplineThicknessKeyFrame" /> class with the specified ending value, key time, and <see cref="T:System.Windows.Media.Animation.KeySpline" />. </summary>
 /// <param name="value">Ending value (also known as "target value") for the key frame.</param>
 /// <param name="keyTime">Key time for the key frame. The key time determines when the target value is reached which is also when the key frame ends.</param>
 /// <param name="keySpline">
 ///       <see cref="T:System.Windows.Media.Animation.KeySpline" /> for the key frame. The <see cref="T:System.Windows.Media.Animation.KeySpline" /> represents a Bezier curve which defines animation progress of the key frame.</param>
 // Token: 0x0600172B RID: 5931 RVA: 0x00071D5B File Offset: 0x0006FF5B
 public SplineThicknessKeyFrame(Thickness value, KeyTime keyTime, KeySpline keySpline) : this()
 {
     if (keySpline == null)
     {
         throw new ArgumentNullException("keySpline");
     }
     base.Value     = value;
     base.KeyTime   = keyTime;
     this.KeySpline = keySpline;
 }
        /// <summary>
        /// Creates a new SplineByteKeyFrame.
        /// </summary>
        public SplineByteKeyFrame(Byte value, KeyTime keyTime, KeySpline keySpline)
            : this()
        {
            if (keySpline == null)
            {
                throw new ArgumentNullException("keySpline");
            }

            Value = value;
            KeyTime = keyTime;
            KeySpline = keySpline;
        }
        /// <summary>
        /// Implemented to linearly interpolate between the baseValue and the
        /// Value of this KeyFrame using the keyFrameProgress.
        /// </summary>
        protected override Thickness InterpolateValueCore(Thickness baseValue, double keyFrameProgress)
        {
            if (keyFrameProgress == 0.0)
            {
                return(baseValue);
            }
            else if (keyFrameProgress == 1.0)
            {
                return(Value);
            }
            else
            {
                double splineProgress = KeySpline.GetSplineProgress(keyFrameProgress);

                return(AnimatedTypeHelpers.InterpolateThickness(baseValue, Value, splineProgress));
            }
        }
Пример #5
0
        public static DoubleAnimationUsingKeyFrames CreateDoubleAnimation(KeySpline toKeySpline, double toValue, double fromValue = 0.0, KeySpline fromKeySpline=null, TimeSpan? beginTimeSpan = null, TimeSpan? durationSpan = null)
        {
            var duration = durationSpan != null ? durationSpan.Value : TimeSpan.FromSeconds(0);
            beginTimeSpan = beginTimeSpan != null ? beginTimeSpan.Value : TimeSpan.FromSeconds(0);

            var animation = new DoubleAnimationUsingKeyFrames
            {
                BeginTime = beginTimeSpan,
                Duration = duration,
            };
            if(fromKeySpline==null)
                animation.KeyFrames.Add(new SplineDoubleKeyFrame(fromValue, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(0))));
            else
                animation.KeyFrames.Add(new SplineDoubleKeyFrame(fromValue, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(0)),fromKeySpline));
            animation.KeyFrames.Add(new SplineDoubleKeyFrame(toValue, KeyTime.FromTimeSpan(duration), toKeySpline));

            return animation;
        }
Пример #6
0
 public SplineInt64KeyFrame(long value, KeyTime keyTime, KeySpline keySpline)
 {
     this.value   = value;
     this.keyTime = keyTime;
     KeySpline    = keySpline;
 }
 public SplineQuaternionKeyFrame(System.Windows.Media.Media3D.Quaternion value, KeyTime keyTime, KeySpline keySpline)
 {
 }
Пример #8
0
	public SplinePointKeyFrame (Point value, KeyTime keyTime, KeySpline keySpline)
	{
		this.value = value;
		this.keyTime = keyTime;
		KeySpline = keySpline;
	}
 public SplineVectorKeyFrame(System.Windows.Vector value, KeyTime keyTime, KeySpline keySpline)
 {
 }
Пример #10
0
 public SplineInt32KeyFrame(int value, KeyTime keyTime, KeySpline keySpline)
 {
     this.value   = value;
     this.keyTime = keyTime;
     KeySpline    = keySpline;
 }
Пример #11
0
 public SplineDoubleKeyFrame(double value, KeyTime keyTime, KeySpline keySpline)
 {
 }
Пример #12
0
	public SplineVectorKeyFrame (Vector value, KeyTime keyTime, KeySpline keySpline)
	{
		this.value = value;
		this.keyTime = keyTime;
		KeySpline = keySpline;
	}
Пример #13
0
 public SplineSingleKeyFrame(float value, KeyTime keyTime, KeySpline keySpline)
 {
     this.value   = value;
     this.keyTime = keyTime;
     KeySpline    = keySpline;
 }
Пример #14
0
	public SplineInt32KeyFrame (int value, KeyTime keyTime, KeySpline keySpline)
	{
		this.value = value;
		this.keyTime = keyTime;
		KeySpline = keySpline;
	}
 public SplineByteKeyFrame(byte value, KeyTime keyTime, KeySpline keySpline)
 {
 }
Пример #16
0
 public SplineInt32KeyFrame(int value, KeyTime keyTime, KeySpline keySpline)
 {
 }
 public SplineQuaternionKeyFrame(System.Windows.Media.Media3D.Quaternion value, KeyTime keyTime, KeySpline keySpline)
 {
 }
 public SplineDecimalKeyFrame(Decimal value, KeyTime keyTime, KeySpline keySpline)
 {
 }
Пример #19
0
 public SplineColorKeyFrame(Color value, KeyTime keyTime, KeySpline keySpline)
 {
     this.value   = value;
     this.keyTime = keyTime;
     KeySpline    = keySpline;
 }
Пример #20
0
 /// <summary> 
  /// Copy the common fields for the various Clone methods
 /// </summary> 
 /// <param name="sourceKeySpline">The KeySpline to copy.</param>
 private void CloneCommon(KeySpline sourceKeySpline)
 {
     _controlPoint1 = sourceKeySpline._controlPoint1; 
     _controlPoint2 = sourceKeySpline._controlPoint2;
     _isDirty = true; 
 } 
 public SplineSizeKeyFrame(System.Windows.Size value, KeyTime keyTime, KeySpline keySpline)
 {
 }
Пример #22
0
 public SplineSingleKeyFrame(float value, KeyTime keyTime, KeySpline keySpline)
 {
 }
Пример #23
0
 public SplineDecimalKeyFrame(Decimal value, KeyTime keyTime, KeySpline keySpline)
 {
     this.value   = value;
     this.keyTime = keyTime;
     KeySpline    = keySpline;
 }
 public SplinePoint3DKeyFrame(System.Windows.Media.Media3D.Point3D value, KeyTime keyTime, KeySpline keySpline)
 {
 }
 public SplineInt16KeyFrame(short value, KeyTime keyTime, KeySpline keySpline)
 {
 }
 public SplineColorKeyFrame(System.Windows.Media.Color value, KeyTime keyTime, KeySpline keySpline)
 {
 }
 public SplineRotation3DKeyFrame(System.Windows.Media.Media3D.Rotation3D value, KeyTime keyTime, KeySpline keySpline)
 {
 }
 public SplineByteKeyFrame(byte value, KeyTime keyTime, KeySpline keySpline)
 {
 }
Пример #29
0
 public SplineInt16KeyFrame(short value, KeyTime keyTime, KeySpline keySpline)
 {
     this.value   = value;
     this.keyTime = keyTime;
     KeySpline    = keySpline;
 }
 public SplineRectKeyFrame(System.Windows.Rect value, KeyTime keyTime, KeySpline keySpline)
 {
 }
Пример #31
0
 public SplinePointKeyFrame(Point value, KeyTime keyTime, KeySpline keySpline)
 {
     this.value   = value;
     this.keyTime = keyTime;
     KeySpline    = keySpline;
 }
Пример #32
0
 public SplineByteKeyFrame(byte value, KeyTime keyTime, KeySpline keySpline)
 {
     this.value   = value;
     this.keyTime = keyTime;
     KeySpline    = keySpline;
 }
Пример #33
0
	public SplineByteKeyFrame (byte value, KeyTime keyTime, KeySpline keySpline)
	{
		this.value = value;
		this.keyTime = keyTime;
		KeySpline = keySpline;
	}
 public SplineDecimalKeyFrame(Decimal value, KeyTime keyTime, KeySpline keySpline)
 {
 }
 public SplinePoint3DKeyFrame(System.Windows.Media.Media3D.Point3D value, KeyTime keyTime, KeySpline keySpline)
 {
 }
Пример #36
0
        private void _AddStoryboard(UIElement panel, double value)
        {
            TransformGroup tGroup = new TransformGroup();
            TranslateTransform translate = new TranslateTransform();
            translate.Y = 0;
            tGroup.Children.Add(translate);
            panel.RenderTransform = tGroup;

            string sbName = (panel as FrameworkElement).Name + "Animation";

            if (Resources.Contains(sbName))
            {
                Storyboard sb = Resources[sbName] as Storyboard;
                DoubleAnimationUsingKeyFrames anim = sb.Children[0] as DoubleAnimationUsingKeyFrames;
                SplineDoubleKeyFrame keyFrame = anim.KeyFrames[0] as SplineDoubleKeyFrame;
                keyFrame.Value = -(value);
            }
            else
            {
                Storyboard sb = new Storyboard();
                sb.SetValue(NameProperty, sbName);
                DoubleAnimationUsingKeyFrames anim = new DoubleAnimationUsingKeyFrames();
                sb.Children.Add(anim);
                Storyboard.SetTargetName(anim, (panel as FrameworkElement).Name);
                Storyboard.SetTargetProperty(anim, new PropertyPath("(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.Y)"));
                anim.BeginTime = new TimeSpan(0, 0, 0);
                SplineDoubleKeyFrame keyFrame = new SplineDoubleKeyFrame();
                KeySpline spline = new KeySpline();
                spline.ControlPoint1 = new Point(0, 1);
                spline.ControlPoint2 = new Point(1, 1);
                keyFrame.KeySpline = spline;
                keyFrame.KeyTime = new TimeSpan(0, 0, 1);
                keyFrame.Value = -(value);
                anim.KeyFrames.Add(keyFrame);
                Resources.Add(sbName, sb);
            }
        }
 public SplineThicknessKeyFrame(System.Windows.Thickness value, KeyTime keyTime, KeySpline keySpline)
 {
 }
Пример #38
0
        private static void AnimateImage(MultiScaleSubImage currentImage, Point futurePosition, Storyboard _moveStoryboard)
        {
            // Create Keyframe
            SplinePointKeyFrame endKeyframe = new SplinePointKeyFrame();
            endKeyframe.Value = futurePosition;
            endKeyframe.KeyTime = KeyTime.FromTimeSpan(TimeSpan.FromSeconds(1));

            KeySpline ks = new KeySpline();
            ks.ControlPoint1 = new Point(0, 1);
            ks.ControlPoint2 = new Point(1, 1);
            endKeyframe.KeySpline = ks;

            // Create Animation
            PointAnimationUsingKeyFrames moveAnimation = new PointAnimationUsingKeyFrames();
            moveAnimation.KeyFrames.Add(endKeyframe);

            Storyboard.SetTarget(moveAnimation, currentImage);
            Storyboard.SetTargetProperty(moveAnimation, new PropertyPath("ViewportOrigin"));

            _moveStoryboard.Children.Add(moveAnimation);
        }
Пример #39
0
	public SplineSingleKeyFrame (float value, KeyTime keyTime, KeySpline keySpline)
	{
		this.value = value;
		this.keyTime = keyTime;
		KeySpline = keySpline;
	}
Пример #40
0
 public SplineRectKeyFrame(Rect value, KeyTime keyTime, KeySpline keySpline)
 {
     this.value   = value;
     this.keyTime = keyTime;
     KeySpline    = keySpline;
 }
Пример #41
0
 /// <summary>
 /// Copy the common fields for the various Clone methods
 /// </summary>
 /// <param name="sourceKeySpline">The KeySpline to copy.</param>
 private void CloneCommon(KeySpline sourceKeySpline)
 {
     _controlPoint1 = sourceKeySpline._controlPoint1;
     _controlPoint2 = sourceKeySpline._controlPoint2;
     _isDirty       = true;
 }
Пример #42
0
 void _SetupYTranslationStoryboard(TranslateTransform transform, string sbName, double translation)
 {
     if (Resources.Contains(sbName))
     {
         Storyboard sb = Resources[sbName] as Storyboard;
         DoubleAnimationUsingKeyFrames anim = sb.Children[0] as DoubleAnimationUsingKeyFrames;
         SplineDoubleKeyFrame keyFrame = anim.KeyFrames[0] as SplineDoubleKeyFrame;
         keyFrame.Value = translation;
     }
     else
     {
         Storyboard sb = new Storyboard();
         sb.SetValue(FrameworkElement.NameProperty, sbName);
         DoubleAnimationUsingKeyFrames anim = new DoubleAnimationUsingKeyFrames();
         sb.Children.Add(anim);
         Storyboard.SetTarget(anim, transform);
         Storyboard.SetTargetProperty(anim, new PropertyPath("Y"));
         anim.BeginTime = new TimeSpan(0, 0, 0);
         SplineDoubleKeyFrame keyFrame = new SplineDoubleKeyFrame();
         KeySpline spline = new KeySpline();
         spline.ControlPoint1 = new Point(0, 1);
         spline.ControlPoint2 = new Point(1, 1);
         keyFrame.KeySpline = spline;
         keyFrame.KeyTime = new TimeSpan(0, 0, 1);
         keyFrame.Value = translation;
         anim.KeyFrames.Add(keyFrame);
         Resources.Add(sbName, sb);
     }
 }
Пример #43
0
	public SplineInt64KeyFrame (long value, KeyTime keyTime, KeySpline keySpline)
	{
		this.value = value;
		this.keyTime = keyTime;
		KeySpline = keySpline;
	}
Пример #44
0
 public SplineSizeKeyFrame(Size value, KeyTime keyTime, KeySpline keySpline)
 {
     this.value   = value;
     this.keyTime = keyTime;
     KeySpline    = keySpline;
 }
 public SplineVector3DKeyFrame(System.Windows.Media.Media3D.Vector3D value, KeyTime keyTime, KeySpline keySpline)
 {
 }
 public SplineInt32KeyFrame(int value, KeyTime keyTime, KeySpline keySpline)
 {
 }
Пример #47
0
	public SplineDoubleKeyFrame (double value, KeyTime keyTime, KeySpline keySpline)
	{
		this.value = value;
		this.keyTime = keyTime;
		KeySpline = keySpline;
	}
Пример #48
0
 public SplineDoubleKeyFrame(double value, KeyTime keyTime, KeySpline keySpline)
 {
     this.value   = value;
     this.keyTime = keyTime;
     KeySpline    = keySpline;
 }
Пример #49
0
 private void ResetNorth( )
 {
     Storyboard sb = new Storyboard();
     sb.Duration = TimeSpan.FromMilliseconds(500.0);
     DoubleAnimationUsingKeyFrames frames= new DoubleAnimationUsingKeyFrames();
     SplineDoubleKeyFrame frame2 = new SplineDoubleKeyFrame();
     frame2.KeyTime = sb.Duration.TimeSpan;
     frame2.Value = 0.0;
     KeySpline spline = new KeySpline();
     spline.ControlPoint1 = new Point(0.0 , 0.1);
     spline.ControlPoint2 = new Point(0.1 , 1.0);
     frame2.KeySpline = spline;
     SplineDoubleKeyFrame frame = frame2;
     frames.KeyFrames.Add(frame);
     if (this.Map.Angle > 180)
     {
         frame.Value = 360.0;
     }//正转到北
     if (this.Map.Angle <= 180)
     {
         frame.Value = 0.0;
     }//转回去
     frames.SetValue(Storyboard.TargetPropertyProperty , new PropertyPath("Angle"));
     sb.Children.Add(frames);
     Storyboard.SetTarget(frames , this.Map);
     sb.Begin();
 }
 public SplineColorKeyFrame(System.Windows.Media.Color value, KeyTime keyTime, KeySpline keySpline)
 {
 }
 public SplineRectKeyFrame(System.Windows.Rect value, KeyTime keyTime, KeySpline keySpline)
 {
 }
 public SplinePointKeyFrame(System.Windows.Point value, KeyTime keyTime, KeySpline keySpline)
 {
 }
Пример #53
0
 private void ResetRotation_Click(object sender, RoutedEventArgs e)
 {
     Storyboard s = new Storyboard {
         Duration = TimeSpan.FromMilliseconds(500.0)
     };
     DoubleAnimationUsingKeyFrames frames = new DoubleAnimationUsingKeyFrames();
     SplineDoubleKeyFrame frame2 = new SplineDoubleKeyFrame {
         KeyTime = s.Duration.TimeSpan,
         Value = 0.0
     };
     KeySpline spline = new KeySpline {
         ControlPoint1 = new Point(0.0, 0.1),
         ControlPoint2 = new Point(0.1, 1.0)
     };
     frame2.KeySpline = spline;
     SplineDoubleKeyFrame keyFrame = frame2;
     frames.KeyFrames.Add(keyFrame);
     keyFrame.Value = 0.0;
     frames.SetValue(Storyboard.TargetPropertyProperty, new PropertyPath("Rotation", new object[0]));
     s.Children.Add(frames);
     Storyboard.SetTarget(frames, this.Map);
     s.Completed += delegate (object sender2, EventArgs e2) {
         s.Stop();
         this.Map.Rotation = 0.0;
     };
     s.Begin();
 }
 public SplineSizeKeyFrame(System.Windows.Size value, KeyTime keyTime, KeySpline keySpline)
 {
 }
Пример #55
0
 public SplineInt16KeyFrame(short value, KeyTime keyTime, KeySpline keySpline)
 {
 }
Пример #56
0
	public SplineRectKeyFrame (Rect value, KeyTime keyTime, KeySpline keySpline)
	{
		this.value = value;
		this.keyTime = keyTime;
		KeySpline = keySpline;
	}
 public SplineVector3DKeyFrame(System.Windows.Media.Media3D.Vector3D value, KeyTime keyTime, KeySpline keySpline)
 {
 }
 public SplineInt64KeyFrame(long value, KeyTime keyTime, KeySpline keySpline)
 {
 }
 public SplineVectorKeyFrame(System.Windows.Vector value, KeyTime keyTime, KeySpline keySpline)
 {
 }