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

  • SEARCH
  • Home
  • 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 7009309
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T21:50:44+00:00 2026-05-27T21:50:44+00:00

WP 7.5 app. I have two Storyboard animations – one on image and another

  • 0

WP 7.5 app. I have two Storyboard animations – one on image and another on Text.

Issue1: When I move to next page and go back, the image and text blinks.

Solution1: So I added OnNavigateFrom and explicity Stop the animations and also reset any properties involved in animations to 0.

Issue2: Now say the screen goes to lock-mode and when I unlock it, since I set opacity of one of my element to 0 in OnNavigatedFrom the element is hidden, which actually should be visible until the user moves to next page.

Solution2: I handled Obscured and UnObscured handler like below in the code and added a flag to see if app is going to obscured mode, do not stop animation or reset properties.

public class Page2 :PhoneApplicationPage
    {
         private bool _isObscured = false;
         public Page2()
        {
            (Application.Current as App).RootFrame.Obscured += OnObscured;
            (Application.Current as App).RootFrame.Unobscured += OnUnobscured;
            InitializeComponent();
        }

        protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e)
        {
            //Stop animations and reset properties only if not going to obscure mode.
            if (!_isObscured)
            {
                //stop animaiton
                Storyboard1.Stop();
                Storyboard2.Stop();
                //Reset all transform properties to 0
                Text1.Opacity = 0;
                Image1.RenderTransform.SetValue(CompositeTransform.ScaleXProperty, 0.0);
                Image1.RenderTransform.SetValue(CompositeTransform.ScaleYProperty, 0.0);
            }
            base.OnNavigatedFrom(e);
        }

        void OnObscured(object sender, ObscuredEventArgs e)
        {
            Storyboard1.Pause();
            Storyboard2.Pause();
            _isObscured = true;
        }

        void OnUnobscured(object sender, EventArgs e)
        {
            Storyboard1.Resume();
            Storyboard2.Resume();
            _isObscured = true;
        }
    }

Question: Is this the corret way to go or is there a better way? Can there be any certification issue for doing it this way?

Any help really appreciated.

  • 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-27T21:50:45+00:00Added an answer on May 27, 2026 at 9:50 pm

    More easiest way is to add IsLeave boolean property and set it to true in click event that calls NavigateTo method. Also, stop animations in the same function too.

    Than you can be sure that, that when you to come back, IsLeave property says you to perform animation or not.

    private bool IsLeave = false;

     OnNavigatedTo()
     {
          if (IsLeave)
          {
               //We come back. Reset animations
               IsLeave = false;
          }
     }
    

    .

     ClickEvent()
     {
          IsLeave = true;
          //Permorm all you need with animations. We leave this page
          NavigationService.NavigateTo()
     }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two animations defined in my silverlight app : <Storyboard x:Name=ShowControls> <DoubleAnimation Duration=0:0:0.2
In my iPad app I have two textfields. One displays the normal, default textfield
Is it possible to have two app.config files where one app.config serves as a
I have two buttons in my flex app next to each other, ButtonA and
In my cocos2d box2d app i have two bodies, the first has one fixture
Is it possible to have two controls on one page side-by-side in Silverlight? It
I have two views in my app, one is a general view where CoreLocation
I have two app domains, one parent creating the child domain. In the child
In my app I have two <select> tags. The first one changes the options
I have two app's projects in two different Eclipse's workspaces. When I run one

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.