Note that there are some explanatory texts on larger screens.

plurals
  1. POAnimation on Page getting stuck upon back navigation
    text
    copied!<p>Windows Phone 7.5 app.</p> <p>Designer has created Home.xaml in Blend that has 3 images(menu item) with storyboard animation. The animation is very simple. Each image enlarges a little and returns to its normal size one after another.</p> <p>It works fine on initial load. Now clicking one image takes me to another page. </p> <p><strong>Issue:</strong> Now when I click back button(hardware) I go to my Home.xaml from navigated page, one of the image is kind of slanted as if it was in is stuck in middle of animation. The animation actaully goes fine for all buttons in cycle but one of the image(it is random which on) gets kind of stuck. Now this behavior is kind of random but can be replicated almost 95% time.</p> <p>I am not sure how the animation fits in the page navigation cycle. I tried to explicitly stop the animation like below in OnNavigatedFrom</p> <pre><code>protected override void OnNavigatedFrom(System.Windows.Navigation.NavigationEventArgs e) { sbBtn1.Stop(); sbBtn2.Stop(); sbBtn3.Stop(); base.OnNavigatedFrom(e); } </code></pre> <p>It is kind of removing the initial problem but then it give another issue. Upon back navigation, the first image of the 3(that's the one that gets animated first upon page navigation) acts as if it is being zoomed-in a little.</p> <p><strong>Edit:</strong></p> <p><em><strong>I figured out the zoom-out issue of the first image. It was using 0.7 scalex/y instead of 0.75.</em></strong></p> <p>If anyone can point me in right direction how to handle this animation please.</p> <p>Here is <a href="https://skydrive.live.com/redir.aspx?cid=64dcca1fdfad16e0&amp;resid=64DCCA1FDFAD16E0!112&amp;parid=64DCCA1FDFAD16E0!106&amp;authkey=!AOIJGF6k4mM05_E" rel="nofollow">the sample</a> I created that replicates the issue. Get the <strong>AnimationIssue</strong> zip file. Let me know if you are not able to download the sample.</p> <p>How to reproduce:</p> <p>1: Click one of the image to go to next page. 2: Then click hardware back button. You will see what I am talking. If not try step 1 and 2 two or three times.</p> <p>Additional:</p> <p>1: IF you comment out stop calls as I mentioned above, follow the steps above but this time notice the first Deserts image. You will see a slight zooming.</p> <p>Hope someone will be able to point me in right direction. Thanks.</p> <p><strong>Final question</strong> So what is wrong in my original version? Am I doing it right to Stop the animation in OnNavigatedFrom or should I do something else?</p> <p>I am also thinking of explicitly call sbBtn1/2/3 .Begin in the page Loaded instead of relying on Triggers in the .xaml.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload