Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6371913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:09:22+00:00 2026-05-25T01:09:22+00:00

I made an animation to rotate my control, but when it’s trigert it just

  • 0

I made an animation to rotate my control, but when it’s trigert it just jumps to final position and then immediately returns to starting position.

The Controls are made from code behind and are TextBoxes with following properties:

FontSize = 45;
TextAlignment = TextAlignment.Center;
Widh = 40;
Heigh = 45;

I store the TextBoxes in array, so I trigger the animation with following code:

foreach (TextBlock b in arrayOfTextBoxes)
{
    Rotate(b);
}

Animation:

public static void Rotate(UIElement target)
{
        var projection = new PlaneProjection();
        target.Projection = projection;

        DoubleAnimation da = new DoubleAnimation();
        da.From = 0;
        da.To = 90;
        da.Duration = TimeSpan.FromSeconds(0.25);
        da.AutoReverse = false;

        Storyboard.SetTargetProperty(da, new PropertyPath(PlaneProjection.RotationZProperty));
        Storyboard.SetTarget(da, projection);

        Storyboard sb = new Storyboard();
        sb.Children.Add(da);

        EventHandler eh = null;
        eh = (s, args) =>
        {
            projection.RotationZ = 90;
            sb.Stop();
            sb.Completed -= eh;
        };
        sb.Completed += eh;

        sb.Begin();
}

EDIT: Now i propably know what’s the problem. I have one (sometimes two) Dispatcher Times ticking in background every second. When I disable them, the proble’s gone. But I can’t do it because I need them to measure time.
Stoping them just before I trigger the animation and them starting them again does’n help.
//The DispetcherTimers do this:

        void tikac_Tick(object sender, EventArgs e)
    {
        herniCas += new TimeSpan(0, 0, 1);
    }

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T01:09:23+00:00Added an answer on May 25, 2026 at 1:09 am

    Animation storyboards will normally hold the last value “until they are stopped”. They do not permanently change the actual property value. They just change its currently rendered value (aren’t dependency properties wonderful? :))

    As you are explicitly stopping it when it ends the value reverts to its original value. Do not stop the storyboard if you want the value to stay changed, or explicitly set it in code when the animation changes.

    The animation in your example is so fast it is just ending very quickly (startup time for storyboards can be a few frames and any time in between is skipped as animations are fixed-time interpolations, not frame specific).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I made a custom viewgroup, and I need to use view animation to rotate
I am just starting out with canvas. I made this: http://www.kingoslo.com/instruments/ The arrow for
i have an animation made by sprite sheet, it is working fine but I
I made a nice dialog with appearing animation in my app. But there is
I just watching my animated sprite code, and get some idea. Animation was made
I have made a fromAlpha=1 toAlpha=0 animation to a view, but every time the
I made an animation with jQuery, everything is written correctly but it doesn't work!!!
I have small animation made with jQuery (panels goes up and comes down). But
I made an animation where 4 divs slide behind another div. I need to
So I've made a 3D animation in flash cs5.5 using ( AS3 and flashPlayer

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.