Quantcast
Channel: Windows Presentation Foundation (WPF) forum
Viewing all articles
Browse latest Browse all 18858

Change Label content via DoubleAnimationUsingKeyFrames in wpf

$
0
0

hello guys

I'm trying to use the following code to change label text using animation:

DoubleAnimationUsingKeyFrames Animation = new DoubleAnimationUsingKeyFrames();
SplineDoubleKeyFrame Spline = new SplineDoubleKeyFrame(0, KeyTime.FromTimeSpan(TimeSpan.Parse("00:00:00")));
Animation.KeyFrames.Add(Spline);
Spline = new SplineDoubleKeyFrame(100, KeyTime.FromTimeSpan(TimeSpan.Parse("00:00:01.4000000")), new KeySpline(0, 0.284, 0.39, 1));
Animation.KeyFrames.Add(Spline);
sRank.BeginAnimation(Label.ContentProperty, Animation);

but its show me this error:

 Cannot animate the 'Content' property on a 'System.Windows.Controls.Label' using a 'System.Windows.Media.Animation.DoubleAnimationUsingKeyFrames'.

How can I change label content via using animation?

tnx guys


:)


Viewing all articles
Browse latest Browse all 18858

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>